đź”® Sanity Create is here. Writing is reinvented. Try now, no developer setup

How to specify the dataset to query in GROQ for an app using Sanity.io.

3 replies
Last updated: Nov 28, 2023
Hi all, I am using 1 public and 1 private dataset for my app. When I use a GROQ query, it only queries the public dataset. How can I specify that it should query the private dataset?
Nov 28, 2023, 6:18 PM
You change the dataset that your client is configured with to the private one.
Nov 28, 2023, 7:02 PM
Aha, thanks! I had forgotten that the dataset is set in the client config.
Nov 28, 2023, 7:03 PM
You’re welcome!
Nov 28, 2023, 7:03 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?