-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typed-document-node: camelCase exports by default? #6585
Comments
Hi! This issue is specific to codegen and not to this repo. I'm moving it. |
@A-Shleifman Can you send a PR with failing tests for |
Sorry, @n1ru4l and @dotansimha for not getting back to this for so long. For example: type GetUserResult = ResultOf<typeof GetUserDocument>; this looks like we're trying to get typeof Type. I think it should be If I try to configure it myself: overwrite: true
schema: "./schema.gql"
documents: "queries.gql"
generates:
graphql.tsx:
plugins:
- typescript
- typescript-operations
- typed-document-node:
namingConvention: change-case-all#camelCase Then the generated variable contains incorrect camelCase types, which should stay PascalCase: export const getUserDocument = {...} as unknown as DocumentNode<getUserQuery, getUserQueryVariables>; Here's an example with TypeScript complaining in |
Somewhat related: is it possible to generate TDNs like |
It seems there should probably be a new option for |
Disappointing to see this option still doesn't exist. |
First of all, thank you for this amazing plugin!
By default it generates TypedDocumentNodes in
PascalCase
. While it makes sense for all generated TypeScript types, it probably should becamelCase
for nodes as they are values rather than types. For example,typescript-react-apollo
generates functions that start with lowercase letters.There's a config option
namingConvention
, but setting it tochange-case-all#camelCase
changes the case of types as well, which is not what we're looking for.It also looks like
omitOperationSuffix
property doesn't work. Ideally, I would like to see the following being generated:Is there a config property I'm missing?
The text was updated successfully, but these errors were encountered: