I currently have two posts published. Both my localhost and domain name are listed in Sanity's CORS settings, but I am consistently encountering an issue where Sanity returns an empty array. Below is the configuration of my Sanity Client:
export default SanityClient({
projectId: "******",
dataset: "production",
useCdn: true,
apiVersion: "2021-10-21",
})
Furthermore, here is how I am utilizing this setup in my NextJS within a getStaticProps function:
const query = `*` // also attempted with `*[_type == "post"]`
return client.fetch(query).then((posts) => {
console.log("data => ", posts)
return {
props: { posts },
}
})