-1

I'm using Gatsby's Gatsby-theme-portfolio and I get an error in graphql query only when I try to build the gatsby site.

There was an error in your GraphQL query:

Response not successful: Received status code 401

   1 | query cUsersLeviDesktopGatsbyPortfolionodeModulesgatsbyThemePortfoliosrccomponentslandingProjectsindexJsx3489004344 {
   2 |   github {
>  3 |     viewer {
     |     ^
   4 |       repositories(first: 8, orderBy: {field: STARGAZERS, direction: DESC}) {
   5 |         edges {
   6 |           node {
   7 |             id
   8 |             name
   9 |             url
  10 |             description
  11 |             stargazers {
  12 |               totalCount
  13 |             }
Developer Hub
  • 183
  • 3
  • 13

1 Answers1

1

There is a Gatsby plugin you can use to source from Github’s GraphQl API. https://www.gatsbyjs.com/plugins/gatsby-source-github-api/. You will need to generate token on Github and pass it in plugin configuration.

Sterlin V
  • 666
  • 2
  • 7
  • 12