See Sanity in action 👀 Join us for a live product demo + Q&A →

Help with GROQ query for finding posts with category "javascript"

2 replies
Last updated: Dec 28, 2022
Sorry, It's me again ://, I need help with this query; I need the category "reference" type equals to the string "javascript"
Like in the docs

*[_type=='movie' && title == 'Arrival']
My query:

[_type=='posts' && categories->{category} == "javascript"]
Dec 28, 2022, 1:19 AM
I'm not sure if this might work but you could try this instead
[_type='post' && references('javascript')]
Dec 28, 2022, 2:10 AM
user C
is right. Btw you are trying to do thing you only can do in projections in your query
user G
. You should checkout
this tutorial here to get a hang of GROQ :saluting_face:it helped me very much when I started with it
Dec 28, 2022, 1:32 PM – build remarkable experiences at scale

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

Categorized in