Unlock seamless workflows and faster delivery with our latest releases – get the details

Understanding the use of '@' in groq for reading fields outside of the reference context.

4 replies
Last updated: Nov 9, 2023
Hi!In groq, while resolving a reference, I want to read a field outside of the reference context. From the 'Query Cheat Sheet - GROQ' I understand the '@' to let me do this, but I am not able to make it work. Does the '@' not work as documented, or am I misunderstanding something?

In the example below I am trying to read the 'isSignLanguage'-field from inside 'rightsList'. See image from Vision:
Nov 9, 2023, 12:35 PM
What do you get if you do

rightsList[]->{
...
}
Nov 9, 2023, 12:37 PM
All the content of the document referred to in rightsList:
Nov 9, 2023, 1:06 PM
@
returns the current scope. I think you may want
^
to access the parent scope (you may need to chain two in your case).
Nov 9, 2023, 3:11 PM
Thanks!
Nov 9, 2023, 8:39 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?