-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcodegen.ts
More file actions
27 lines (23 loc) · 637 Bytes
/
Copy pathcodegen.ts
File metadata and controls
27 lines (23 loc) · 637 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
import { type CodegenConfig } from "@graphql-codegen/cli";
const PROD_ENDPOINT = "https://fill.papermc.io/graphql";
function getSchema() {
if (process.env.USE_PROD_ENDPOINT === "true") {
return PROD_ENDPOINT;
}
return "http://localhost:8080/graphql";
}
const config: CodegenConfig = {
schema: getSchema(),
documents: ["src/**/*.svelte", "src/**/*.ts", "src/**/*.svelte.ts"],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
"./src/lib/gql/": {
preset: "client",
plugins: [],
config: {
useTypeImports: true,
},
},
},
};
export default config;