-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgraphql.config.ts
40 lines (38 loc) · 1008 Bytes
/
graphql.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
36
37
38
39
40
import type { CodegenConfig } from '@graphql-codegen/cli'
import { loadEnvConfig } from '@next/env'
loadEnvConfig(process.cwd())
const config: CodegenConfig = {
generates: {
'generated/graphql.ts': {
documents: './components/**/*.graphql',
schema: {
[`${process.env.NEXT_PUBLIC_BIGCOMMERCE_STOREFRONT_URL}`]: {
headers: {
Authorization: `Bearer ${process.env.NEXT_PUBLIC_BIGCOMMERCE_STOREFRONT_API_TOKEN}`,
},
},
},
plugins: [
'typescript',
'typed-document-node',
{
'typescript-operations': {
strictScalars: true,
scalars: {
BigDecimal: 'number',
DateTime: 'string',
Long: 'number',
},
},
},
],
config: {
// namingConvention: {
// enumValues: './pascalCaseWithUnderscores',
// },
nonOptionalTypename: true,
},
},
},
}
export default config