Replace legacy emitter with mutation pipeline and TypeGraph output#83
Merged
swatkatz merged 4 commits intoJun 9, 2026
Conversation
FionaBronwen
force-pushed
the
fionabronwen/graphql-alloy-foundation-v2
branch
from
April 21, 2026 16:24
8b51ca4 to
8f411e1
Compare
FionaBronwen
force-pushed
the
fionabronwen/graphql-foundation-skeleton
branch
from
April 21, 2026 16:25
afdf684 to
ce78164
Compare
2 tasks
FionaBronwen
force-pushed
the
fionabronwen/graphql-foundation-skeleton
branch
4 times, most recently
from
April 22, 2026 17:09
193c59a to
95f3757
Compare
FionaBronwen
marked this pull request as ready for review
April 22, 2026 17:14
FionaBronwen
force-pushed
the
fionabronwen/graphql-alloy-foundation-v2
branch
from
April 28, 2026 15:28
8f411e1 to
5f26c25
Compare
FionaBronwen
force-pushed
the
fionabronwen/graphql-foundation-skeleton
branch
3 times, most recently
from
May 1, 2026 15:33
97fc964 to
962b388
Compare
FionaBronwen
force-pushed
the
fionabronwen/graphql-foundation-skeleton
branch
2 times, most recently
from
June 3, 2026 19:59
f8eeedb to
73724f4
Compare
swatkatz
force-pushed
the
fionabronwen/graphql-alloy-foundation-v2
branch
3 times, most recently
from
June 8, 2026 20:24
3f74c91 to
21abccf
Compare
- Delete legacy emitter infrastructure (graphql-emitter.ts, registry.ts, schema-emitter.ts, type-maps.ts, types.d.ts) - New $onEmit: type-usage → mutation engine → buildTypeGraph → render (stub) - Add schema-mutator.ts: walks namespace, mutates all types via engine, produces TypeGraph. No pre-classified buckets — renderer classifies at render time using decorators and typeUsage. - Add empty-schema diagnostic when no operations exist - Emitter test updated to verify pipeline runs (rendering TBD) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
swatkatz
force-pushed
the
fionabronwen/graphql-foundation-skeleton
branch
from
June 8, 2026 20:46
73724f4 to
e26c0b4
Compare
Tests verify: - Mutated models/enums/scalars/unions/operations appear in TypeGraph - Unreachable types are excluded when omitUnreachableTypes is true - All declared types included when omitUnreachableTypes is false - T | null unions are not registered in the TypeGraph - Union wrapper models (scalar variants) are included - Array models are skipped (they're list types, not object types) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The mutation engine already handles T | null unions correctly (replaces with inner type). The pre-check was a premature optimization that added code without benefit — engine.mutate() is cached. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Without this, navigateTypesInNamespace on the global namespace visits built-in TypeSpec scalars (string, int32, etc.) from the TypeSpec sub-namespace, adding them to the TypeGraph unnecessarily. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
@swatkatz Additions LGTM! thank youu! |
swatkatz
reviewed
Jun 9, 2026
swatkatz
left a comment
There was a problem hiding this comment.
Since Fiona is the author, she can't officially approve this PR, so I am approving it on her behalf as I wrote the code, so it is fine to swap roles: https://pinterest.slack.com/archives/C08UD3MR5QT/p1781035408754549?thread_ts=1780928581.664069&cid=C08UD3MR5QT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the legacy emitter infrastructure with the new mutation pipeline:
graphql-emitter.ts,registry.ts,schema-emitter.ts,type-maps.ts,types.d.ts$onEmit: type-usage → mutation engine →buildTypeGraph→ render (stub)schema-mutator.ts: walks namespace, mutates all types, produces aTypeGraph— no pre-classified bucketsempty-schemawarning when no operations existThe renderer (future PR) walks
typeGraph.globalNamespaceand classifies types at render time usingisInterface(),isOneOf(),typeUsage.getUsage().Key design decisions
MutatedSchemawith pre-sorted arrays. Classification is a renderer concern, not a mutation concern.mutateSchemais ~65 lines — walk, mutate, buildTypeGraph. All the complexity lives in the mutation classes (PRs Add naming pipelines, buildTypeGraph, and printMutatedType to mutation engine #88, Add structural transforms: union naming, collapsing, record-to-scalar #89).Test plan
Stacked on #77.
🤖 Generated with Claude Code