apollographql / apollographql/apollo-tooling

Add an option to remove underscores from generated interfaces.

Open
#1,414 5 comments 35 reactions 0 assignees View on GitHub
🤖 component - codegen
Dominant language
TypeScript
Stars
3k
Forks
460
PR merge metrics
No merged PRs in 30d

Description

Codegen generates interfaces with underscores.

For example: `myQuery_foo_bar`.

This default behaviour causes problems when using ESLint camelcase rule -https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/camelcase.md.

Importing these interfaces triggers a linting error.

I'd suggest adding `--no-underscores` flag that would cause interfaces to be generated without underscores. For example: `myQueryFooBar`.

Contributor guide

Open the contributing guide

Research direction

Start by locating the code generation entry point that turns GraphQL names into TypeScript interfaces, then trace how command-line options are parsed. Confirm the existing underscore behavior with a generated example, and consider the work complete when the requested option produces names like myQueryFooBar without breaking default output.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.