what is the recommended way to query an array of references?

3 replies
Last updated: Oct 11, 2020
what is the recommended way to query an array of references? For example right now I have a field
articles
of type array of elements with type
article
and right now I'm doing this:
	articles[]{
		'article': @->
	}
but it forces me to have everything nested under
article
which I'd like to avoid if possible
Oct 11, 2020, 1:01 PM
	articles[]->{
	  ...
	}
This will do the trick
😀
Oct 11, 2020, 1:51 PM
	articles[]->{
	  ...
	}
This will do the trick
😀
Oct 11, 2020, 1:51 PM
thanks! knew there had to be a concise solution there 🙂
Oct 11, 2020, 2:33 PM

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?