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
{{ message }}
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
👋 Hello I've been noticing some behavior from the groq-codegen tool that doesn't look quite right. I've noticed when I have a query that uses an array projection, the type of the first field determines the rest of the types of the fields. For example, if I have a query like so:
Assume that field-1 is type string and field-2 is a number. When the groq-codegen completes the query type will say that both field-1andfield-2` are strings. If i switched the query around to look like this:
*[_type == 'my-type' && _id == $typeId]{
"outer": outer[]-> {
field-2 <------ field-2 is first now
field-1
}
the generated query type will say that the types of both field-1 and field-2 are numbers. This also seems to be true if I put any other type first. Am I missing something in my query, or is this an actual issue?
The text was updated successfully, but these errors were encountered:
itsHabib
changed the title
Incorrect Groq Codegened Types when using array projection
Incorrect groq codegened types when using array projection
Mar 23, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version:
@sanity-codegen/groq-codegen": "1.0.0-alpha.26"
.👋 Hello I've been noticing some behavior from the
groq-codegen
tool that doesn't look quite right. I've noticed when I have a query that uses an array projection, the type of the first field determines the rest of the types of the fields. For example, if I have a query like so:Assume that
field-1
is typestring
andfield-2
is anumber. When the groq-codegen completes the query type will say that both
field-1and
field-2` are strings. If i switched the query around to look like this:the generated query type will say that the types of both
field-1
andfield-2
are numbers. This also seems to be true if I put any other type first. Am I missing something in my query, or is this an actual issue?The text was updated successfully, but these errors were encountered: