Describe the bug
The generated code has a space like below.
export function useTodoStateLazy Query(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<SchemaTypes.ITodoStateQuery, SchemaTypes.ITodoStateQueryVariables>) {
return ApolloReactHooks.useLazyQuery<SchemaTypes.ITodoStateQuery, SchemaTypes.ITodoStateQueryVariables>(TodoStateDocument, baseOptions);
};
To Reproduce
Steps to reproduce the behavior:
codegen.yml config file: models.tsx:
documents: "packages/files-client-state/src/**/*.gql"
schema:
- ./packages/client-state/src/**/*.graphql
- ./packages-modules/module/server/src/graphql/**/*.graphql
config:
namingConvention: keep
typesPrefix: I
withMutationFn: true
withHOC: true
withComponent: true
withHooks: true
preset: "@cdmbase/import-types-preset"
presetConfig:
typesPath: "core"
importTypesNamespace: SchemaTypes
Expected behavior
export function useTodoStateLazy Query(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<SchemaTypes.ITodoStateQuery, SchemaTypes.ITodoStateQueryVariables>) {
return ApolloReactHooks.useLazyQuery<SchemaTypes.ITodoStateQuery, SchemaTypes.ITodoStateQueryVariables>(TodoStateDocument, baseOptions);
};
Environment:
@graphql-codegen/...: 1.6.1Additional context
This is because titleCase from change-case is adding the space here
require('change-case').titleCase('LazyQuery') === 'Lazy Query'
From reading the change-case docs, I think this should be pascalCase instead.
Most helpful comment
From reading the change-case docs, I think this should be
pascalCaseinstead.