-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgraphql.config.ts
More file actions
23 lines (19 loc) · 796 Bytes
/
graphql.config.ts
File metadata and controls
23 lines (19 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import type { IGraphQLConfig } from "graphql-config";
import { loadEnvConfig } from "@next/env";
loadEnvConfig(process.cwd());
const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID
const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET
export const sanityURL = `https://${projectId}.api.sanity.io/v1/graphql/${dataset}/default`;
export const jsChileURL = `https://graphql-api.jsconfcl.workers.dev/graphql`;
export const localSchema = `./src/gql/schema.gql`;
export const sanityDocuments = [
"src/**/*.gql",
"app/**/*.gql",
"!src/features/import/**/*.gql",
];
export const apiDocuments = ["src/features/import/**/*.gql"];
const config: IGraphQLConfig = {
schema: [sanityURL, jsChileURL, localSchema],
documents: [...sanityDocuments, ...apiDocuments],
};
export default config;