Skip to content

Commit

Permalink
fix: provider-specific file naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewvolk committed Jun 17, 2024
1 parent 59c2cde commit 826d44d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion client/graphql.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
};
Expand Down
11 changes: 8 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": ".",
Expand Down

0 comments on commit 826d44d

Please sign in to comment.