Replies: 1 comment
-
Glad you found the answer to the problem! In GROQ, every nested projection has a nested scope too. Sometimes there's confusion because there's shorthand syntax that make the
Hopefully this explanation helps! Happy coding! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
FIGURED IT OUT (thanks Gemini)
I had to do a sub-projection and access that query builder object for it to correctly project from nested objects (I think):
PROBLEM
I've been using GROQD on a personal project and enjoying it. But today I've been having a bit of trouble accessing array fields and was wondering if someone could help me understand how to access these properties correctly.
Type
Query
The above query returns the correct data but GROQD flags a type error
The query below satisfies GROQD type checking
but throws a runtime error in the Nextjs application.
Any help appreciated!
Beta Was this translation helpful? Give feedback.
All reactions