Open hazem3500 opened 4 years ago
Apparently the Access Token isn't passed to the WrapPage
Component when using StaticQuery with WithPreview HOC
Hey @hazem3500, you don't need any accessToken for the production or the preview to use this plugging.
I thought the access token was the issue, then why am I getting "Syntax Error: Unexpected Name "undefined""
?
I'm facing the same error. Any resolution for this issue? Thanks!
Same problem here!
@hazem3500 @ecomonestop I just realized that (at least for pages) you need to export your query with the name query
e.g.
export const query = graphql`
query HOME_HERO_QUERY {
...
}
`;
This is caused by one of gatsby-source-prismic-graphql's dependencies https://github.com/birkir/gatsby-source-graphql-universal/blob/817d99dd28285b30c05c132405c47bf208656cd3/src/getRootQuery.js#L13
I get this error when using withPreview with StaticQuery component
"Syntax Error: Unexpected Name "undefined""
here is my component