dotansimha / dotansimha/graphql-code-generator

typed-document-node: camelCase exports by default?

Open
#6,585 6 comments 4 reactions 0 assignees View on GitHub
core help wanted kind/enhancement waiting-for-answer
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

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:

```ts
export const getUserQuery = ...;
export const deleteUserMutation = ...;
```

Is there a config property I'm missing?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.