GROQ - How to Query Pages Only Aimed at One Locale

1 replies
Last updated: Aug 2, 2021
SOLVED--
I am trying to query pages that have
localeSlug
set only in French, but my lack of CROQ experience brings progress to halt pretty quickly...
I’ve thought of 1) checking for the
length / size of slug field to be 1
(or 2 if _type has to be considered)
AND slug.fr.current != null
(I don’t know how to check the size/length), and 2) checking that
slug.fr.current != null AND all others be null
(I know the list of languages but still can’t get this to work as they’re undefined).
Any thoughts? Thanks!
Aug 2, 2021, 12:15 PM
&amp;&amp; !defined(slug.en) &amp;&amp; !defined(<http://slug.de|slug.de>) &amp;&amp; ...
does it
Aug 2, 2021, 1:07 PM

Sanity.io – 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