-
Notifications
You must be signed in to change notification settings - Fork 304
Expand file tree
/
Copy pathcodegen.ts
More file actions
42 lines (38 loc) · 1022 Bytes
/
Copy pathcodegen.ts
File metadata and controls
42 lines (38 loc) · 1022 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
37
38
39
40
41
42
import type { CodegenConfig } from '@graphql-codegen/cli';
const endpoint = process.env.GQL_HOST || 'https://secure.woonuxt.com/graphql';
const origin = process.env.APP_HOST || new URL(endpoint).origin;
const schemaLoaderOptions: Record<string, unknown> = {
headers: {
Origin: origin,
},
assumeValid: true,
};
const config: CodegenConfig = {
overwrite: true,
schema: [
{
[endpoint]: schemaLoaderOptions,
},
],
documents: ['woonuxt_base/app/queries/**/*.gql'],
generates: {
'woonuxt_base/app/gql/default.ts': {
plugins: [
{
add: {
content:
'/* eslint-disable */\n// @ts-nocheck\n// This file is auto-generated. Do not edit manually — run `npm run graphql:codegen` to regenerate.\n',
},
},
'typescript',
'typescript-operations',
'typescript-graphql-request',
],
config: {
rawRequest: false,
useTypeImports: true,
},
},
},
};
export default config;