dotansimha/graphql-code-generator

typed-document-node: camelCase exports by default?

Open

#6.585 aberto em 29 de ago. de 2021

Ver no GitHub
 (6 comments) (4 reactions) (0 assignees)TypeScript (1.295 forks)batch import
corehelp wantedkind/enhancementwaiting-for-answer

Métricas do repositório

Stars
 (10.341 stars)
Métricas de merge de PR
 (Mesclagem média 22d 9h) (53 fundiu PRs em 30d)

Description

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 be camelCase 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 to change-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:

export const getUserQuery = ...;
export const deleteUserMutation = ...;

Is there a config property I'm missing?

Guia do colaborador