Repository navigation
Replies: 1 comment
|
TypeScript works fine. The catch is that multi-project configs are read by graphql-config, not by codegen's own config loader. If you put Give the file a graphql-config name instead ( // graphql.config.ts
import type { IGraphQLConfig } from 'graphql-config';
const config: IGraphQLConfig = {
projects: {
a: {
schema: 'a.graphql',
extensions: { codegen: { generates: { 'a.ts': { plugins: ['typescript'] } } } },
},
b: {
schema: 'b.graphql',
extensions: { codegen: { generates: { 'b.ts': { plugins: ['typescript'] } } } },
},
},
};
export default config;npx graphql-codegen --project a
npx graphql-codegen --project bI tested this with @graphql-codegen/cli 8.0.0 (graphql-config 6.0.0): each project generated its own file and the config type-checks. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The docs for Multi Project use a JavaScript file, but there is no explanation provided about why JavaScript is used instead of TypeScript.
I tried to use TypeScript for the config file but I got an error.
Why can't we use TypeScript for the config file in a multi-project context?
All reactions