👋 Next.js Conf 2024: Come build, party, run, and connect with us! See all events

Resolving a query issue with Sanity's GROQ parsers

2 replies
Last updated: Jun 12, 2024
*[_type=="trendingPage"][0]{
  nodes[]->{
    ...,
    prices[] | order(period asc) {
      period,
      "id": _key
    }
  }
}
Hi, this should be a valid query right? I get the value I am expecting when I do this but when I try to generate types for this query, I get the error, "Cannot determine property key for type: PipeFuncCall" and sanity typegen do not generate the type of the query.
Am I doing something wrong?
Jun 12, 2024, 10:15 PM
Hi!
That looks like a discrepancy between our different groq parsers.



*[_type=="trendingPage"][0]{
  nodes[]->{
    ...,
    "prices": prices[] | order(period asc) {
      period,
      "id": _key
    }
  }
}

Should work and yield the same result
Jun 12, 2024, 10:36 PM
THANK YOU!It works! You helped me a lot on this, really appreciate it.
Jun 12, 2024, 11: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?