forked from Uniswap/wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.ts
24 lines (22 loc) · 908 Bytes
/
codegen.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import type { CodegenConfig } from '@graphql-codegen/cli'
// https://the-guild.dev/graphql/codegen/docs/getting-started/development-workflow#monorepo-and-yarn-workspaces
// A single codegen config for every app/package
// This will pull graphql queries from every app/package and ouput a single
// typescript file. This optimizes for sharing, but can be split out in the
// future if unwieldy.
const config: CodegenConfig = {
overwrite: true,
schema: 'packages/wallet/src/data/__generated__/schema.graphql',
// pulls every graphql files in a single config
documents: '**/src/**/*.graphql',
generates: {
// generates a single output for every app and package
'packages/wallet/src/data/__generated__/types-and-hooks.ts': {
plugins: ['typescript', 'typescript-operations', 'typescript-react-apollo'],
config: {
withHooks: true,
},
}
}
}
export default config