apollographql / apollographql/apollo-tooling

Code generation doesn't delete unused files

Open
#711 9 comments 23 reactions 0 assignees View on GitHub
:tada: feature
Dominant language
TypeScript
Stars
3k
Forks
460
PR merge metrics
No merged PRs in 30d

Description

Because codegen puts things in their own `__generated__` folder adjacent to the file containing the queries, if you move a query, the old file remains and clutters up IDE autocomplete. This inhibits the refactoring process.

I believe developer experience would be improved if the old file were deleted or if all the types were placed in a global types file.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the code generation path that writes files into the adjacent __generated__ folder. Determine how moved queries are detected and whether stale outputs can be identified safely; the issue leaves deletion versus a global types file as an unresolved design choice. Done means the chosen approach prevents obsolete generated files from cluttering IDE autocomplete.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.