Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blog-post component needs fixing for GraphQL query to run successfully #37

Open
shingkid opened this issue Jan 31, 2023 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@shingkid
Copy link
Owner

warn The GraphQL query in the non-page component "devfolio/src/templates/blog-post.jsx" will not be run.
Exported queries are only executed for page components. It's possible you're trying to create pages in your gatsby-node.js and that's failing for some
reason.

If the failing component is a regular component and not intended to be a page component, you generally want to use "useStaticQuery"
(https://www.gatsbyjs.com/docs/how-to/querying-data/use-static-query/) instead of exporting a page query.

If you're more experienced with GraphQL, you can also export GraphQL fragments from components and compose the fragments in the Page component query and
 pass data down into the child component (https://www.gatsbyjs.com/docs/reference/graphql-data-layer/using-graphql-fragments/)
@shingkid shingkid added the bug Something isn't working label Jan 31, 2023
@shingkid shingkid self-assigned this Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant