project_graphql_blog icon indicating copy to clipboard operation
project_graphql_blog copied to clipboard

Blog posts aren't updating

Open dannstarr opened this issue 2 years ago • 4 comments

I seem to have everything set up correctly, no error messages etc, and it really is a great Blog app. One issue that I notice is that once I publish a post in GraphCMS, I don't seem to be able to update it - it just stays as it was on the first publish.

Say I want to go back to the post content and correct a spelling, add to it, or change it in any way, the latest changes never show up on the live site, despite Graph CMS saying that the updates have been saved and published.

The only way these changes show on the live site, is if I make a change to the files in VS Code, and then push the changes to github, and redeploy to Vercel

dannstarr avatar May 15 '22 18:05 dannstarr

When creating, publishing, unpublishing, or editing content, simply click on Start Building to trigger a new Vercel build.

8

akinolapo avatar May 26 '22 22:05 akinolapo

I seem to have everything set up correctly, no error messages etc, and it really is a great Blog app. One issue that I notice is that once I publish a post in GraphCMS, I don't seem to be able to update it - it just stays as it was on the first publish.

Say I want to go back to the post content and correct a spelling, add to it, or change it in any way, the latest changes never show up on the live site, despite Graph CMS saying that the updates have been saved and published.

The only way these changes show on the live site, is if I make a change to the files in VS Code, and then push the changes to github, and redeploy to Vercel

The same thing happens to me. when I am in developer mode the posts update without problems but in build mode when I make a post it only updates in the carousel (<FeaturedPost />) but not in the body <PostCard />. The only way these changes show is if I make push the changes to github, and redeploy to vercel.

manuetov avatar Jun 12 '22 21:06 manuetov

Try to use revalidate property in the index.jsx.

export async function getStaticProps() {
  const posts = (await getPosts()) || [];
  return {
    props: { posts },
    revalidate: 10
  };
}

Nefiox avatar Jun 17 '22 03:06 Nefiox

with revalidate, now it's working perfectly. Thank you so much!!


From: Juan Jiménez @.> Sent: Friday, June 17, 2022 5:15 AM To: adrianhajdin/project_graphql_blog @.> Cc: manuetov @.>; Comment @.> Subject: Re: [adrianhajdin/project_graphql_blog] Blog posts aren't updating (Issue #30)

Try to use revalidate propertyhttps://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration in the index.jsx.

export async function getStaticProps() { const posts = (await getPosts()) || []; return { props: { posts }, revalidate: 10 }; }

— Reply to this email directly, view it on GitHubhttps://github.com/adrianhajdin/project_graphql_blog/issues/30#issuecomment-1158445492, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARPC62MLXEPGGWUBQMEIYJDVPPUUZANCNFSM5V7ODU5Q. You are receiving this because you commented.Message ID: @.***>

manuetov avatar Jun 17 '22 10:06 manuetov