Last active
May 7, 2022 16:54
-
-
Save hrdtbs/35b10260301f5beb944136e855f71623 to your computer and use it in GitHub Desktop.
Easy way to use Github GraphQL API with graphql-codegen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
overwrite: true | |
schema: 'https://docs.github.com/public/schema.docs.graphql' | |
documents: 'src/**/*.graphql' | |
generates: | |
src/__generated__/graphql.ts: | |
plugins: | |
- typescript | |
- typescript-operations | |
- typescript-react-query | |
config: | |
skipTypename: true | |
fetcher: | |
endpoint: 'https://api.github.com/graphql' | |
isReactHook: true | |
fetchParams: > | |
{ | |
headers: { | |
"Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | |
} | |
} | |
./graphql.schema.json: | |
plugins: | |
- 'introspection' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment