Skip to content

Instantly share code, notes, and snippets.

@Renaud009
Last active October 21, 2022 19:47
Show Gist options
  • Save Renaud009/ba1ded1c3cff9e543eaa8996d23a4e0a to your computer and use it in GitHub Desktop.
Save Renaud009/ba1ded1c3cff9e543eaa8996d23a4e0a to your computer and use it in GitHub Desktop.
Graphql codegen config
overwrite: true
schema: 'https://{{LOCAL_API_ENDPOINT}}:3443/graphql'
generates:
src/services/graphqlApi.generated.ts:
documents: 'src/services/graphql/*.graphql'
plugins:
- 'typescript'
- 'typescript-operations'
- 'typescript-msw'
- typescript-rtk-query:
importBaseApiFrom: './emptyGraphqlApi'
exportHooks: true
overrideExisting: 'module.hot?.status() === "apply"'
src/apps/{{APPLICATION_NAME}}/services/graphqlApi.generated.ts:
documents: 'src/apps/{{APPLICATION_NAME}}/**/graphql/*.graphql'
plugins:
- 'typescript'
- 'typescript-operations'
- 'typescript-msw'
- typescript-rtk-query:
importBaseApiFrom: '../../../services/graphqlApi.generated'
exportHooks: true
overrideExisting: 'module.hot?.status() === "apply"'
dev/schema.graphql:
plugins:
- schema-ast
config:
includeDirectives: true
sort: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment