dotansimha / dotansimha/graphql-code-generator
TypeScript Operations should have declarationKind option for type queries and fragments
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
### Which packages are impacted by your issue?
@graphql-codegen/typescript-resolvers
### Describe the bug
Setting declarationKind to "class" doesn't target fragments, queries or QueryVariables
### Your Example Website or App
https://codesandbox.io/p/sandbox/hardcore-flower-mvv7y2
### Steps to Reproduce the Bug or Issue
Use codesandbox template and add
`config: { declarationKind: "class" },`
### Expected behavior
I expect all exports to be classes
### Screenshots or Videos

### Platform
- OS: macOS
- NodeJS: [e.g. 16.17.0]
"@graphql-codegen/typescript": "2.8.0",
"@graphql-codegen/typescript-operations": "2.5.5",
"graphql": "^16.2.0"
### Codegen Config File
import { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
schema: "schema.graphql",
documents: "document.graphql",
generates: {
"types.ts": {
config: { declarationKind: "class" },
plugins: ["typescript", "typescript-operations"],
},
},
};
export default config;
### Additional context
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.