👋 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 bothfield-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?
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?