forked from 1a35e1/sonar-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen.ts
More file actions
36 lines (34 loc) · 940 Bytes
/
Copy pathcodegen.ts
File metadata and controls
36 lines (34 loc) · 940 Bytes
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
36
import type { CodegenConfig } from '@graphql-codegen/cli'
// https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-graphql-request
const config: CodegenConfig = {
overwrite: true,
schema: 'https://api.sonar.8640p.info/graphql',
documents: ['src/**/*'],
hooks: {
afterAllFileWrite: ['pnpm biome check --write src/types/sonar.ts --linter-enabled=false'],
},
generates: {
'./src/types/sonar.ts': {
plugins: [
'typescript',
'typescript-operations',
'typescript-graphql-request',
],
config: {
rawRequest: true,
extensionsType: 'unknown',
noGraphQLTag: true,
strictScalars: true,
scalars: {
JSON: 'JSON',
DateTime: 'Date',
_Any: 'unknown',
Any: 'unknown',
},
// documentMode: 'string',
// defaultScalarType: 'unknown',
},
},
},
}
export default config