Skip to content

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
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.

2 participants