dotansimha/graphql-code-generator

typed-document-node: camelCase exports by default?

Open

#6.585 geöffnet am 29. Aug. 2021

Auf GitHub ansehen
 (6 Kommentare) (4 Reaktionen) (0 zugewiesene Personen)TypeScript (1.295 Forks)batch import
corehelp wantedkind/enhancementwaiting-for-answer

Repository-Metriken

Stars
 (10.341 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 22T 9h) (53 gemergte PRs in 30 T)

Beschreibung

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?

Contributor Guide