Answers from the community about GROQ

Some of the conversations between community members on questions, suggestions and tips for using Sanity. Join our Discord to be a part of it.

TopicCategoriesFeaturedRepliesLast Updated
GROQ: Reference parent person ID in nested castMembers filter4Mar 18, 2024
Transform array of objects to named object keys in GROQ query3Feb 29, 2024
Compare two arrays for intersection in GROQ query5Feb 28, 2024
How to get only published results in GROQ?4Feb 12, 2024
GROQ query injection security and parameter sanitization6Feb 7, 2024
How to query original image dimensions and format in GROQ without transformations?9Jan 24, 2024
How to pass dynamic WHERE conditions as parameters in GROQ queries?3Dec 12, 2023
How to specify querying a private dataset instead of public in GROQ?4Nov 28, 2023
How to access parent field from reference context using @ in GROQ?5Nov 9, 2023
Matching array values between two arrays in GROQ query3Oct 18, 2023
How to extract year/hour from datetime fields in GROQ queries?6Oct 10, 2023
GROQ: How to fetch all items except the first one using slice?3Oct 6, 2023
Reference field value within same GROQ query without variables7Sep 21, 2023
Issue with basic groq query in Sanity not returning expected results.7Sep 19, 2023
GROQ: Conditional query based on empty array result4Sep 12, 2023
Count images in array of content blocks with GROQ3Sep 7, 2023
GROQ: Handling null values when concatenating strings3Aug 15, 2023
GROQ webhook fails with 403 "Missing Authentication Token" on production dataset8Aug 10, 2023