forked from Portkey-Wallet/portkey-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodegen.config.ts
35 lines (32 loc) · 863 Bytes
/
codegen.config.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
25
26
27
28
29
30
31
32
33
34
35
import { CodegenConfig } from '@graphql-codegen/cli';
import schemaPath from './schemaPath.config.js';
const config: CodegenConfig = {
generates: {},
config: {
scalars: {
Long: 'number',
},
},
};
schemaPath.forEach(({ name, path }) => {
config.generates[`./src/${name}/__generated__/types.ts`] = {
schema: path,
plugins: ['typescript'],
};
config.generates[`${name}/`] = {
documents: [`./src/${name}/__generated__/operation/**/*`],
schema: path,
preset: 'near-operation-file',
presetConfig: {
baseTypesPath: `../src/${name}/__generated__/types.ts`,
extension: '.ts',
folder: `../../hooks`,
},
plugins: ['typescript-operations', 'typescript-react-apollo'],
// plugins: ['typescript-operations'],
config: {
// defaultBaseOptions: {}
},
};
});
export default config;