dotansimha/graphql-code-generator

typed-document-node: camelCase exports by default?

开放

#6,585 创建于 2021年8月29日

 (6 条评论) (4 个反应) (0 位负责人)TypeScript (1,295 个派生)batch import
corehelp wantedkind/enhancementwaiting-for-answer

仓库指标

星标
 (10,341 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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?

贡献者指南