I am working on a personal portfolio website in NextJS and implementing a blog feature using hygraph for storing posts (built based off of the default nextjs blog). However I’m encountering a strange issue. I deleted and changed my posts and am left with a single post called ‘Test’. In my site the old 2 default example posts attached to the project (that I deleted) are showing up and not test.
However the default NextJS blog example they provided is working just fine.
My code is identical in terms of fetching data:
Hygraph starter project code to get all posts:
async function getPosts() {
const client = HygraphClient()
const allPosts = await client.request(AllPosts)
return allPosts.posts
}
// later in the project
const allPosts = await getPosts()
My project:
async function getPosts() {
const client = HygraphClient()
const allPosts = await client.request(AllPosts)
return allPosts.posts
}
// later in the project
const allPosts = await getPosts()
I expected both to work the same.
I’m poorly versed in JS and am so close to finishing this project. Any and all would be greatly appreciated!