-
Notifications
You must be signed in to change notification settings - Fork 2
/
codegen.yml
33 lines (33 loc) · 894 Bytes
/
codegen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
overwrite: true
schema:
- './tools/sdl/tmp/schema.gql'
documents: ['src/**/*.{tsx,ts}']
generates:
src/graphql/api.tsx:
config:
noNamespaces: true
contextType: ../pages/api/context#GraphQLClientContext
apolloReactCommonImportFrom: '@apollo/client'
apolloReactHooksImportFrom: '@apollo/client'
withHooks: true
withRefetchFn: true
withComponent: false
withHOC: false
scalars:
Function: 'Function'
AsyncFunction: '() => Promise<any>'
plugins:
- typescript
- typescript-operations
- typescript-react-apollo
- typescript-resolvers
src/graphql/api-ssr.tsx:
config:
reactApolloVersion: 3
withHooks: true
apolloClientInstanceImport: './apollo-client'
preset: import-types
presetConfig:
typesPath: ./api
plugins:
- 'graphql-codegen-apollo-next-ssr'