Don't print GraphQL query in the non-page component will not be run error in unused templates
See original GitHub issueI can not find out how to get rid of these warnings in console log during build time.
warn The GraphQL query in the non-page component "...some path..." will not be run.
Cause of warning is unused template and not GraphQL in non-page component at the first place.
Sice I use headless CMS for sourcing Gatsby I can not rely that CMS user creates always all page types for all Gatsby’s templates. Thus it is common for me that some templates remain unused. I was looking for some “if” condition to prevent this warning but unsuccessfully. So currently my log is filling with this misleading information.
It would be nice to have a way how to say that unused templates can be intentional and do not printing warnings.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:13 (2 by maintainers)
Top Results From Across the Web
reactjs - GraphQL query complaints in non-page component ...
The GraphQL query in the non-page component "C:/GitRepos/gatsby-blog-starter/src/templates/blogPost.js" will not be run.
Read more >Five Common Problems in GraphQL Apps (And How to Fix ...
Schema duplication; Server/client data mismatch; Superfluous database calls; Poor performance; Boilerplate overdose. I'm willing to bet your app ...
Read more >Frontend testing standards and style guidelines - GitLab Docs
This assumes that implementation details of behavior under test should be covered by that component's individual unit test. There is no strong preference...
Read more >Top 18 Most Common AngularJS Developer Mistakes - Toptal
Sheer size of the AngularJS can easily lead to many mistakes. In this article you will learn about most common AngularJS developer mistakes...
Read more >Build a Secure Blog with Gatsby, React, and Netlify
"C:/work/gatsby/gatsby-netlify-okta/src/templates/blog.js” will not be run. Exported queries are only executed for Page components. It's ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is still a problem.
Steps to reproduce
I’m shadowing queries of a theme.
Expected result
I should not get warnings. The queries should execute for page components.
Actual result
Environment