Currently, I am in the process of developing my personal portfolio website using NextJS and incorporating a blog feature with hygraph for post storage (which is derived from the default nextjs blog setup). However, I have stumbled upon an unusual issue. After deleting and modifying my posts, I find myself with only one post titled 'Test'. Strangely, on my site, the old two default example posts that were originally part of the project (but were deleted) are being displayed instead of 'Test'.
The default NextJS blog example provided works perfectly fine, but for some reason, mine does not. Both use identical code to fetch data:
async function getPosts() {
const client = HygraphClient()
const allPosts = await client.request(AllPosts)
return allPosts.posts
}
// later in the project
const allPosts = await getPosts()
In my own project, the fetching code is exactly the same:
async function getPosts() {
const client = HygraphClient()
const allPosts = await client.request(AllPosts)
return allPosts.posts
}
// later in the project
const allPosts = await getPosts()
I had anticipated that both implementations would yield similar results.
My expertise in JavaScript is somewhat limited, but I am nearing the completion of this project. Any help or advice would be greatly welcomed!