Unlock seamless workflows and faster delivery with our latest releases – get the details

Debugging Groq query type issue in Sanity typegen

7 replies
Last updated: Jun 7, 2024
I have a Groq query that works perfectly fine, but the generated type from sanity typegen gives me
Array<never>
.
Is this a good place to debug this? I’ll put more details in the thread.
Jun 5, 2024, 7:03 PM
The Groq query. Screenshot of Vision attached so we can see it does work.

*[_type == "post" && mainPostType->slug.current == "guides"]|order(publishedAt desc){
  title
}
Jun 5, 2024, 7:04 PM
If I remove
&& mainPostType->slug.current == "guides"
the generated type is correct.
Jun 5, 2024, 7:04 PM
👋 What version of the CLI are you using?
Jun 5, 2024, 7:10 PM
🤦 I updated to the latest, re-ran generate, and it’s good to go now.
Jun 5, 2024, 7:12 PM
Thanks for the fast reply, y’all are great.
Jun 5, 2024, 7:12 PM
Glad it was an easy fix!
Jun 5, 2024, 7:14 PM
I am having the same issue with all the latest versions. Any help please?
Jun 7, 2024, 9:19 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?