You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working off of the gatsby-portfolio-dev repo. This repo uses graphQL to query github projects to display on the portfolio. I'm not sure if this is a bug or I'm just missing something. The apiCall to github is returning an error.
I added my github token as described and I'm getting
Error: The result of this StaticQuery could not be fetched.
This is likely a bug in Gatsby and if refreshing the page does not fix it, please open an issue in https://github.com/gatsbyjs/gatsby/issues
useStaticQuery
/Users/julietrubin/Documents/code/portfolio/.cache/gatsby-browser-entry.js:63
60 | if (context[query] && context[query].data) {
61 | return context[query].data
62 | } else {
> 63 | throw new Error(
64 | `The result of this StaticQuery could not be fetched.\n\n` +
65 | `This is likely a bug in Gatsby and if refreshing the page does not fix it, ` +
66 | `please open an issue in https://github.com/gatsbyjs/gatsby/issues`
ERROR #85901 GRAPHQL
There was an error in your GraphQL query:
context is not defined
1 | query usersjulietrubinDocumentscodeportfoliosrccomponentslandingProjectsindexJsx3032228125 {
2 | github {
> 3 | viewer {
| ^
4 | id
5 | repositories(first: 8, orderBy: {field: STARGAZERS, direction: DESC}) {
6 | edges {
7 | node {
8 | id
9 | name
10 | url
11 | description
12 | stargazers {
13 | totalCount
Steps to reproduce
gatsby new gatsby-portfolio-dev https://github.com/smakosh/gatsby-portfolio-dev
yarn build
yarn start
It says "context" is not defined and that refers to the page context that you setup in gatsby-node, which runs at build time.
You will have an inital GraphQL query in Gatsby Node just to fetch the ID or some other unique identifier in the response and pass that as the context, which will be used in your page query to fetch the correct response.
@crock Thanks for the response. I am working directly off of https://github.com/smakosh/gatsby-portfolio-dev. The only change I made was to add my GITHUB_TOKEN as described. I also verified process.env.GITHUB_TOKEN contains my token with a console log.
Description
I am working off of the gatsby-portfolio-dev repo. This repo uses graphQL to query github projects to display on the portfolio. I'm not sure if this is a bug or I'm just missing something. The apiCall to github is returning an error.
I added my github token as described and I'm getting
Steps to reproduce
Expected result
Have the github api request be success.
Actual result
Getting an error message
Environment
The text was updated successfully, but these errors were encountered: