You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a problem I stumbled upon after we upgraded one of our projects from v2 to v3 of Sanity Studio.
We have a custom structure for the studio with different document lists, that filter documents based on different groq queries, using the S.documentList().filter() function.
All queries that contain the count() function cause an Interval server error ("Could not fetch list items. Error: Internal server error"). When we remove the count() from the query, the list displays just fine.
Interestingly enough, doing count([1,2,3]) works while count(foo) where foo is the name of a field of type 'array' in a document's schema causes the error.
Also, the query itself hasn't been changed and has been working fine for the last year or so in v2 of Sanity Studio.
To Reproduce
Steps to reproduce the behavior:
Set up a fresh Sanity Studio installation.
Add a document schema with at least one field of type 'array'
Set up a structure and add a documentList to display documents of the type you just created
Add a filter that includes the count() function
Expected behavior
The expected behavior would be for the query to not cause an error and to behave the same way as when querying the API or using the Vision tool.
Which versions of Sanity are you using?
@sanity/cli (global) 3.36.4 (latest: 3.38.0)
@sanity/components 2.14.0 (up to date)
@sanity/document-internationalization 3.0.0 (up to date)
@sanity/eslint-config-studio 4.0.0 (up to date)
@sanity/image-url 1.0.2 (up to date)
@sanity/ui 2.1.4 (up to date)
@sanity/vision 3.38.0 (up to date)
sanity 3.38.0 (up to date)
What operating system are you using?
MacOS 14.2.1
Which versions of Node.js / npm are you running?
10.5.0
v21.7.3
The text was updated successfully, but these errors were encountered:
luk-str
changed the title
Using count() in a documentList filter query results in a 500 Internal Server Error
[BUG] Using count() in a documentList filter query results in a 500 Internal Server Error
Apr 23, 2024
Describe the bug
This is a problem I stumbled upon after we upgraded one of our projects from v2 to v3 of Sanity Studio.
We have a custom structure for the studio with different document lists, that filter documents based on different groq queries, using the
S.documentList().filter()
function.All queries that contain the
count()
function cause an Interval server error ("Could not fetch list items. Error: Internal server error"). When we remove thecount()
from the query, the list displays just fine.Interestingly enough, doing
count([1,2,3])
works whilecount(foo)
wherefoo
is the name of a field of type 'array' in a document's schema causes the error.Also, the query itself hasn't been changed and has been working fine for the last year or so in v2 of Sanity Studio.
To Reproduce
Steps to reproduce the behavior:
count()
functionExpected behavior
The expected behavior would be for the query to not cause an error and to behave the same way as when querying the API or using the Vision tool.
Which versions of Sanity are you using?
@sanity/cli (global) 3.36.4 (latest: 3.38.0)
@sanity/components 2.14.0 (up to date)
@sanity/document-internationalization 3.0.0 (up to date)
@sanity/eslint-config-studio 4.0.0 (up to date)
@sanity/image-url 1.0.2 (up to date)
@sanity/ui 2.1.4 (up to date)
@sanity/vision 3.38.0 (up to date)
sanity 3.38.0 (up to date)
What operating system are you using?
MacOS 14.2.1
Which versions of Node.js / npm are you running?
10.5.0
v21.7.3
The text was updated successfully, but these errors were encountered: