forked from Uniswap/interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen.ts
More file actions
26 lines (23 loc) · 1.03 KB
/
Copy pathcodegen.ts
File metadata and controls
26 lines (23 loc) · 1.03 KB
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
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 output a single
// typescript file. This optimizes for sharing, but can be split out in the
// future if unwieldy.
const config: CodegenConfig = {
overwrite: true,
schema: 'src/data/graphql/uniswap-data-api/schema.graphql',
// pulls every graphql files in a single config
documents: ['../../apps/{mobile,extension}/src/**/*.graphql', '../../packages/{wallet,uniswap}/src/**/*.graphql'],
generates: {
// generates a single output for every app and package
'src/data/graphql/uniswap-data-api/__generated__/types-and-hooks.ts': {
plugins: ['typescript', 'typescript-operations', 'typescript-react-apollo', 'typescript-resolvers'],
config: {
withHooks: true,
maybeValue: 'T | undefined',
},
},
},
}
export default config