The hardcoded behavior for typenames appears to be to retain the casing, whereas the default for the typescript plugin is to use pascalCase. As a result, there is a mismatch between the types generated by the two plugins: a type name such as ETPObject yields EtpObject with typescriptand ETPObject with typescript-mock-data.
Fortunately the typescript plugin allows to change the naming convention for typenames, so this can be worked around like this:
generates:
./schema/lib/clientTypes.tsx:
plugins:
- typescript
config:
namingConvention:
typeNames: keep # for compatibility with typescript-mock-data
However, this means I need to adjust my existing code because hooks such as useGetEtpObjects have become useGetETPObjects.
It would be good to have matching default behaviors and maybe also matching configuration options.
The hardcoded behavior for typenames appears to be to retain the casing, whereas the default for the
typescript
plugin is to usepascalCase
. As a result, there is a mismatch between the types generated by the two plugins: a type name such asETPObject
yieldsEtpObject
withtypescript
andETPObject
withtypescript-mock-data
.Fortunately the
typescript
plugin allows to change the naming convention for typenames, so this can be worked around like this:However, this means I need to adjust my existing code because hooks such as
useGetEtpObjects
have becomeuseGetETPObjects
.It would be good to have matching default behaviors and maybe also matching configuration options.
Thanks.