Either straight up remove or add a toggle to disable the automatic pascal-casing that the hook is given, which conflicts with the injectedRtkApi.
For example, I have a graphql query named ordersByAccountID, but then the hook generates as getOrderesByAccountIdQuery, throwing an error because the D is generated as lowercase, when the API object returns it as a capitalized D.
See comment on bottom line about changing the singular character to fix the problem
Experiment changing the config.namingConvention, I was unable to figure it out with this.
Expected behavior
I expect to either, either:
[ ] Get a hook that matches the default value of the GraphQL operation
[ ] Have the ability to modify the hook naming convention with the config.namingConvention object.
I just read that Pascal Case is industry standard, but I do also find it helpful to allow developers to customize to their liking if the config's are already there
Screenshots or Videos
This is the problem as it appears in our full scale codebase - many operations are showing as errors due to ending with ID
I was able to work around this by changing my schema to conform to pascalCase. However, I believe this is a limitation of the parser that should be AT LEAST mentioned as a limitation.
Which packages are impacted by your issue?
@graphql-codegen/typescript-rtk-query
Describe the bug
Either straight up remove or add a toggle to disable the automatic pascal-casing that the hook is given, which conflicts with the
injectedRtkApi
.For example, I have a graphql query named
ordersByAccountID
, but then the hook generates asgetOrderesByAccountIdQuery
, throwing an error because the D is generated as lowercase, when the API object returns it as a capitalized D.Your Example Website or App
https://stackblitz.com/~/github.com/charlieforward9/graphql-codegen-typescript-rtk-query-hook-name-bug
Steps to Reproduce the Bug or Issue
Experiment changing the
config.namingConvention
, I was unable to figure it out with this.Expected behavior
I expect to either, either:
config.namingConvention
object.I just read that Pascal Case is industry standard, but I do also find it helpful to allow developers to customize to their liking if the config's are already there
Screenshots or Videos
This is the problem as it appears in our full scale codebase - many operations are showing as errors due to ending with
ID
Platform
graphql
version: 16.8.1@graphql-codegen/cli
: 5.0.2@graphql-codegen/typescript-rtk-query
: ^3.1.1Codegen Config File
No response
Additional context
No response