diff --git a/.gitignore b/.gitignore index f9483fe..c868f28 100644 --- a/.gitignore +++ b/.gitignore @@ -40,8 +40,8 @@ next-env.d.ts # generated client/generated -schema.graphql -graphql-env.d.ts +bigcommerce.graphql +bigcommerce-graphql.d.ts # secrets .catalyst diff --git a/client/graphql.ts b/client/graphql.ts index a47f30a..c0d2346 100644 --- a/client/graphql.ts +++ b/client/graphql.ts @@ -1,6 +1,6 @@ import { initGraphQLTada } from 'gql.tada'; -import type { introspection } from '~/graphql-env'; +import type { introspection } from '~/bigcommerce-graphql'; export const graphql = initGraphQLTada<{ introspection: introspection; diff --git a/scripts/generate.cjs b/scripts/generate.cjs index c60d815..7f3773c 100644 --- a/scripts/generate.cjs +++ b/scripts/generate.cjs @@ -47,13 +47,13 @@ const generate = async () => { await generateSchema({ input: getEndpoint(), headers: { Authorization: `Bearer ${getToken()}` }, - output: join(__dirname, '../schema.graphql'), + output: join(__dirname, '../bigcommerce.graphql'), tsconfig: undefined, }); await generateOutput({ disablePreprocessing: false, - output: join(__dirname, '../graphql-env.d.ts'), + output: undefined, tsconfig: undefined, }); }; diff --git a/tsconfig.json b/tsconfig.json index 417d76d..5571894 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -33,10 +33,15 @@ }, { "name": "@0no-co/graphqlsp", - "schema": "./schema.graphql", - "tadaOutputLocation": "./graphql-env.d.ts", "trackFieldUsage": false, - "shouldCheckForColocatedFragments": false + "shouldCheckForColocatedFragments": false, + "schemas": [ + { + "name": "bigcommerce", + "schema": "./bigcommerce.graphql", + "tadaOutputLocation": "./bigcommerce-graphql.d.ts" + } + ] } ], "baseUrl": ".",