-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.ts
39 lines (37 loc) · 1007 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
import { CodegenConfig } from "@graphql-codegen/cli";
// import { API_URL } from "lib/const";
require("dotenv").config();
const config: CodegenConfig = {
schema: [
{
[`https://${process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN}/api/2022-07/graphql.json`]:
{
headers: {
"X-Shopify-Storefront-Access-Token":
process.env.NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN,
},
},
},
],
documents: ["./src/**/**/*.graphql"],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
"./src/generated/graphql.ts": {
// preset: "client",
plugins: [
"typescript",
"typescript-operations",
"typescript-react-query",
],
config: {
fetcher: "graphql-request",
addInfiniteQuery: true,
legacyMode: false,
exposeFetcher: true,
exposeQueryKeys: true,
exposeMutationKeys: true,
},
},
},
};
export default config;