Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Querying a schema returns an empty array after breaking website into multiple pages.

3 replies
Last updated: Aug 22, 2023
i dont know why am having an empty array after querying a schema, and in my studio i have two items i was working before when my website was a single page but now am breaking it to multiple pages, thats when i started getting this error
Aug 22, 2023, 9:53 AM
Is the name of your document
product
or
products
? If it is the former, your query should be:
*[_type == 'product']{
  ...,
}
Aug 22, 2023, 2:36 PM
yes it is, totally skipped my mind. thanks so much is working now
Aug 22, 2023, 2:42 PM
product
Aug 22, 2023, 2:42 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?