-
Notifications
You must be signed in to change notification settings - Fork 4
/
codegen.ts
41 lines (37 loc) · 868 Bytes
/
codegen.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
41
import "dotenv/config";
import type { CodegenConfig } from "@graphql-codegen/cli";
const {
CONTENTFUL_SPACE_ID,
CONTENTFUL_ENVIRONMENT_ID,
CONTENTFUL_ACCESS_TOKEN,
} = process.env;
const config: CodegenConfig = {
overwrite: true,
schema: [
{
[`https://graphql.contentful.com/content/v1/spaces/${CONTENTFUL_SPACE_ID}/environments/${CONTENTFUL_ENVIRONMENT_ID}`]:
{
headers: {
Authorization: `Bearer ${CONTENTFUL_ACCESS_TOKEN}`,
},
},
},
],
documents: ["src/**/*.tsx", "src/**/*.ts"],
generates: {
"generated/": {
preset: "client",
plugins: [
"typescript",
"typescript-operations",
"typescript-graphql-request",
{
add: {
content: "// @ts-nocheck",
},
},
],
},
},
};
export default config;