Gatsby Prismic preview and useStaticQuery

I was wondering if preview works for useStaticQuery on a Gatsby project?

I’m using the gatsby-source-prismic plugin and I noticed last week when setting up preview for a client that content updates don’t show for useStaticQuery queries, is there a way to get it to work or does preview not work for content pulled in with useStaticQuery?

Thanks in advance,

I found the solution to this problem.

If anyone else comes across this problem, the short answer is don’t use useStaticQeury instead you’ll need to use a graphql fragment, this doc on the Prismic site has the answer you’re looking for Tutorial Series 5: Add the navigation - Prismic

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.