This sample project has been created to showcase how one can integrate another GraphQL API in gatsby project. This integration with another GraphQL server is achieved using gatsby-source-graphql plugin. You can find simple configuration and the steps to setup the project.
-
Clone this repo.
git clone https://github.com/gouravsood/gatsby-source-graphql-usage
-
Install the dependencies
npm install
-
Get GitHub Access Token
- Navigate into Github Settings > Developer Settings > Personal access tokens. or directly go here https://github.com/settings/tokens
- Click 'Generate new token' and assign scope provided here in the documentation https://developer.github.com/v4/guides/forming-calls/#authenticating-with-graphql
-
Run the application!
GITHUB_TOKEN=<token-generated-above> gatsby develop
-
Open the source code and start editing!
Your site is now running at
http://localhost:8000
!
Looking for more guidance? Full documentation for Gatsby lives on the website. Here are some places to start:
-
For most developers, we recommend starting with our in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.
-
To dive straight into code samples head to our documentation. In particular, check out the “Guides”, API reference, and “Advanced Tutorials” sections in the sidebar.