Skip to content

Remove stale generated imports#32

Merged
ruudk merged 1 commit intomainfrom
remove-stale-imports
Jan 15, 2026
Merged

Remove stale generated imports#32
ruudk merged 1 commit intomainfrom
remove-stale-imports

Conversation

@ruudk
Copy link
Owner

@ruudk ruudk commented Jan 15, 2026

When a file is moved or refactored, the hash in generated import paths
changes. Previously, the generator would add the new correct import but
leave the old stale import behind, requiring manual cleanup.

This adds a StaleImportRemover visitor that automatically removes use
statements matching the generated namespace pattern (Query/Mutation
with 6-char hex hash) that don't match the current valid FQCNs.

When a file is moved or refactored, the hash in generated import paths
changes. Previously, the generator would add the new correct import but
leave the old stale import behind, requiring manual cleanup.

This adds a StaleImportRemover visitor that automatically removes use
statements matching the generated namespace pattern (Query/Mutation
with 6-char hex hash) that don't match the current valid FQCNs.
@ruudk ruudk force-pushed the remove-stale-imports branch from fd11401 to b7a03ef Compare January 15, 2026 10:34
@ruudk ruudk merged commit 1870036 into main Jan 15, 2026
5 checks passed
@ruudk ruudk deleted the remove-stale-imports branch January 15, 2026 10:38
ruudk added a commit that referenced this pull request Feb 14, 2026
ruudk added a commit that referenced this pull request Feb 14, 2026
Revert "Remove stale generated imports (#32)"

This reverts commit 1870036.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant