Skip to content

Instantly share code, notes, and snippets.

@praveenweb
Created September 5, 2019 11:46
Show Gist options
  • Save praveenweb/4bb26a4bdfe38c2ed1c570a8ed6413f2 to your computer and use it in GitHub Desktop.
Save praveenweb/4bb26a4bdfe38c2ed1c570a8ed6413f2 to your computer and use it in GitHub Desktop.
graphql-code-generator-config
module.exports = {
"schema": [
{
"http://localhost:8080/v1/graphql": {
"headers": {
// neccessary auth headers to fetch schema
}
}
}
],
"documents": [
"./src/**/*.tsx",
"./src/**/*.ts"
],
"overwrite": true,
"generates": {
"./src/generated/graphql.tsx": {
"plugins": [
"typescript",
"typescript-operations",
"typescript-react-apollo"
],
"config": {
"skipTypename": false,
"withHooks": true,
"withHOC": false,
"withComponent": false
}
},
"./graphql.schema.json": {
"plugins": [
"introspection"
]
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment