Closed oyvind-stenhaug closed 3 weeks ago
For what it's worth, this is a simplified case. My actual query is more like
*[_type == "mainDocumentType" && slug.current == $slug]{
...,
portableTextField[]{
...,
_type == "someCustomBlockType" => {
_type,
"nested": *[
_type == "anotherDocumentType" && type in ^.types && (...more stuff)
]{
${NESTED_QUERY_PROJECTION}
}
},
${PORTABLE_TEXT_PROJECTION}
}
}[0]
This should now be fixed in the latest release https://github.com/sanity-io/sanity/releases/tag/v3.56.0
Closing for now, feel free to reopen if this is still an issue
If you find a security vulnerability, do NOT open an issue. Email security@sanity.io instead.
Describe the bug
When a GROQ query uses the
in
operator in a filter component, the TypeGen-generated type of the query result ends up asArray
.To Reproduce
src/queries.ts
file with these contents:npx sanity schema extract && npx sanity typegen generate && cat sanity.types.ts
, and observe theQueryWithInResult
typeExpected behavior
(which is the result generated if you use a filter that involves
==
instead ofin
)Actual behavior
Which versions of Sanity are you using?
What operating system are you using?
GNU/Linux (Ubuntu 22.04.4 LTS)
Which versions of Node.js / npm are you running?
npm -v && node -v
:10.2.4 v20.11.1