Contentful logo

Contentful Community

How do I redo GraphQL query locally to get content changes, without restarting my server (npm run dev)?

Apologies if this is not the right topic to post under, mods please feel free to move!

I’ve just started with Gatsby + Contentful using the “Launch onboarding button” and the starter repo (starter-gatsby-blog). I am familiar with React but not very familiar with GraphQL or Contentful.

When I make an edit to my content on Contentful, I restart my server ( npm run dev ) in order to query for those changes, but that takes quite a few seconds. I am used to instantaneous changes in React :upside_down_face:

Is there a faster way to redo the GraphQL query during local development, without having to restart my server entirely? Thanks!

Also posted here: Gatsby + Contentful - how do I redo GraphQL query locally without restarting my server (npm run dev)? - Stack Overflow

Ah someone on SO answered! https://stackoverflow.com/a/67850771/3700490

Re-posting here:

1 Like