Feature Request: better error message if templates in /pages/ and get an error #29870
Unanswered
muescha
asked this question in
Ideas / Feature Requests
Replies: 2 comments
-
Yeah, makes sense to improve this. Thanks for the issue! |
Beta Was this translation helpful? Give feedback.
0 replies
-
related issue with same problem (template used from
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
if templates are placed "accidently" in
/pages
then they run twice, one time fromgatsby-node.js
and one more time "unexpected" with the automatic/pages
stepBasic example
see Issue:
Variable "$skip" of required type "Int!" was not provided
Improvements
possible improvements:
1) Context
print also the context variables when a graphql error is printed, then a user see if he have just a typo or all other variables are missing.
2) Hints in error text
add a hint to the error message about automatic running the pages when the file is placed in
/pages/
3) Add warnings
add a check if a file from
/pages/
is called fromcreatePage(
ingatsby-node.js
(or in a similar lifecycle step other than the automaticpages
step) and print a warning - maybe as an example:there exists a similar check for the templates:
Motivation
For new users it is hard to find out why the variables are missing in this case
Related Issues:
Variable "$skip" of required type "Int!" was not provided
Beta Was this translation helpful? Give feedback.
All reactions