graphql-code-generator
graphql-code-generator copied to clipboard
typescript-operations does not support declarationKind
Which packages are impacted by your issue?
@graphql-codegen/typescript-operations
Describe the bug
Set declarationKind: 'interface', and types generated by the typescript plugin switch to using interface, but typescript-operation types still use type, despite typescript-operations documenting that declarationKind is a supported option.
Your Example Website or App
n/a
Steps to Reproduce the Bug or Issue
- Setup a project that uses typescript and typescript-operations
- Set
declarationKindtointerface
Expected behavior
typescript-operation types switch to using interface
Screenshots or Videos
No response
Platform
- OS: macOS 13
- NodeJS: 18
graphql: 16@graphql-codegen/*@graphql-codegen/typescript-operations: 2.5.7
Codegen Config File
schema: "../backend/src/graphql_server//*.graphql" documents: "./src/graphql//*.graphql" extensions: codegen: overwrite: true config: dedupeFragments: true noNamespaces: true strict: true scalars: Date: string DateTime: string useExplicitTyping: true declarationKind: "interface" generates: src/generated/graphql/graphql.tsx: plugins: - "typescript" - "typescript-operations" - "fragment-matcher" - "typed-document-node"
Additional context
No response
At the very least the documentation should be updated to reflect this reality - I spent a fair amount of time trying to make it work. https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-operations#declarationkind
Still an issue, wasted a lot of time trying to get this to work before finding this issue.
We also need this. Its not very useful if you cant map it on an OO model without having to maintain the whole model your self.
Hi all 👋
Major version changes are under work: https://github.com/dotansimha/graphql-code-generator/pull/10496 This will most likely be included in that. Will keep this issue updated with news