-
Notifications
You must be signed in to change notification settings - Fork 15
/
codegen.ts
38 lines (36 loc) · 904 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
import type { CodegenConfig } from "@graphql-codegen/cli";
import * as dotenv from "dotenv";
dotenv.config();
const config: CodegenConfig = {
overwrite: true,
documents: ["**/*.graphql"],
schema: [
{
[process.env.HOLAPLEX_API_ENDPOINT as string]: {
headers: {
Authorization: process.env.HOLAPLEX_AUTH_TOKEN as string,
},
},
},
"./schema.graphql",
],
generates: {
"./holaplex.graphql": {
schema: {
[process.env.HOLAPLEX_API_ENDPOINT as string]: {
headers: {
Authorization: process.env.HOLAPLEX_AUTH_TOKEN as string,
},
},
},
plugins: ["schema-ast"],
},
"./@types/graphql.d.ts": {
plugins: ["typescript-graphql-files-modules"],
},
"./src/graphql.types.ts": {
plugins: ["typescript", "typescript-resolvers"],
},
},
};
export default config;