-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Which packages are impacted by your issue?
@graphql-codegen/cli, @graphql-codegen/typescript
Describe the bug
Here's a basic example of codegen two TS schemas. You can see that QueryColorAllArgs is incorrectly documented. Unclear why it's getting the Query documentation (4) from version.ts.
colors.ts
export default gql`
"1. Queries for retrieving colors"
type Query {
"2. Returns all colors"
colors(
"3. Filter colors by scope"
scope: [String]
): [String]
}
`;versions.ts
export default gql`
"4. Queries for retrieving available versions"
type Query {
"5. Returns all available versions"
versions: [String]
}
`;types.ts
/** 4. Queries for retrieving available versions */
export type Query = {
__typename?: 'Query';
/** 2. Returns all colors */
colors?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
/** 5. Returns all available versions */
versions?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
};
/** 4. Queries for retrieving available versions */
export type QueryColorsArgs = {
scope?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
};Your Example Website or App
https://github.com/bigtimebuddy/graphql-codegen-bug
Steps to Reproduce the Bug or Issue
- Clone repo (https://github.com/bigtimebuddy/graphql-codegen-bug)
- Run
npm install - Run
npm test - See src/generated/types.ts
Expected behavior
I'm expecting argument comments from the schema to get correctly assigned in the output arg types OR at show no comments. Comments are incorrect assigned from another schema.
Screenshots or Videos
No response
Platform
- OS: macOS
- NodeJS: v18.20.5
@graphql-codegen/cliversion: 5.0.3@graphql-codegen/typescriptversion: 4.1.2
Codegen Config File
overwrite: true
generates:
./src/generated/types.ts:
schema:
- "src/schemas/*.ts"
plugins:
- "typescript"
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels