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

Cannot query field "github" on type "Query" #22

Closed
oldmannt opened this issue Jan 14, 2019 · 2 comments
Closed

Cannot query field "github" on type "Query" #22

oldmannt opened this issue Jan 14, 2019 · 2 comments

Comments

@oldmannt
Copy link

I just follow the setup, didn't change anything else.

error Plugin gatsby-source-graphql returned an error
...
  ServerError: Response not successful: Received status code 401
...
error GraphQL Error Unknown field `github` on type `Query`
file: [path]/gatsby-mail/src/components/footer.js

   1 |
   2 |         query FooterQuery {
>  3 |           github {
     |           ^
   4 |             repository(owner: "dschau", name: "gatsby-mail") {
   5 |               stargazers {
   6 |                 totalCount
   7 |               }
   8 |             }
   9 |           }
  10 |           site {
  11 |             siteMetadata {
  12 |               repository {
  13 |                 url
 ERROR  Failed to compile with 1 errors                                                                                                                                      12:14:17 AM

 error  in ./src/components/footer.js

Module Error (from ./node_modules/eslint-loader/index.js):

[path]/gatsby-mail/src/components/footer.js
  58:11  error  Cannot query field "github" on type "Query"  graphql/template-strings

✖ 1 problem (1 error, 0 warnings)

 @ ./src/layouts/index.js 19:0-42 71:42-48
 @ ./node_modules/gatsby-plugin-layout/wrap-page.js
 @ ./node_modules/gatsby-plugin-layout/gatsby-browser.js
 @ ./.cache/api-runner-browser-plugins.js
 @ ./.cache/api-runner-browser.js
 @ ./.cache/app.js
 @ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app

macOS Mojave

@oldmannt
Copy link
Author

After I delete # https://github.com/settings/tokens in .env.development
It works.

Thank you for building this demo!

@dnafication
Copy link

dnafication commented Mar 11, 2019

This helped. We can remove the comment line from the code itself and add the information in the comments on the top to avoid this confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants