Add operation components, orchestrator, and emitter rendering#84
Open
FionaBronwen wants to merge 2 commits into
Open
Conversation
4 tasks
79f53c2 to
41fbefb
Compare
3387127 to
1a5163c
Compare
41fbefb to
8a187c4
Compare
9e90b36 to
ffc3f0f
Compare
ffa9c95 to
fe7da60
Compare
f73791c to
ce4affb
Compare
618e444 to
1f7438a
Compare
ce4affb to
98fb4f4
Compare
2ef9793 to
db9b099
Compare
98fb4f4 to
eb57da4
Compare
db9b099 to
6cd9324
Compare
eb57da4 to
2be2c50
Compare
6cd9324 to
671900f
Compare
2be2c50 to
c975212
Compare
255e13b to
15743c4
Compare
Brings the component-based GraphQL emitter online by wiring the data pipeline from the foundation skeleton into Alloy JSX rendering. New components: - components/operations/query-type.tsx, mutation-type.tsx, subscription-type.tsx: render the three GraphQL root operation types - components/operations/index.ts: barrel export - components/type-collections.tsx: orchestrator that dispatches each classified-type bucket (scalars, enums, unions, interfaces, objects, inputs) into the appropriate leaf-type component Emitter wiring: - Rename src/emitter.ts → src/emitter.tsx - Phase 5 now renders via Alloy's renderSchema, converts to SDL with graphql-js printSchema, and writes the output via emitFile - Adds output-file option handling with interpolatePath Testing: - test/e2e.test.ts: single happy-path smoke test proving the full TypeSpec → mutation → classification → rendering → SDL pipeline works - Update the existing test/emitter.test.ts data-pipeline test to now assert that SDL output is produced (Phase 5 is wired up) Broader integration coverage (nullability, input/output splitting, unions, enums, arrays, circular refs, deprecation, doc comments) lands in a follow-up PR focused on tests.
2bd9c31 to
918f6cc
Compare
Adds component tests for QueryType, MutationType, and SubscriptionType using inline snapshots. Tests cover rendering with scalar return types, model return types (with stub type registration), parameters, and empty operation lists. Updates renderComponentToSDL utility to support skipPlaceholderQuery option for testing QueryType, while maintaining backwards compatibility with existing tests that pass context overrides directly. Also cleans up e2e and emitter tests to use consistent vitest expect() assertions with toMatchInlineSnapshot() instead of mixed strictEqual and .includes() checks.
918f6cc to
cf1eb14
Compare
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
QueryType,MutationType,SubscriptionType(incomponents/operations/) render the three GraphQL root operation typescomponents/type-collections.tsxdispatches each classified-type bucket (scalars, enums, unions, interfaces, objects, inputs) into the appropriate leaf-type componentsrc/emitter.ts→src/emitter.tsx. Phase 5 now renders via Alloy'srenderSchema, converts to SDL withgraphql-jsprintSchema, and writes the output viaemitFile. Addsoutput-fileoption handling withinterpolatePath.test/components/operation-types.test.tsxwith 10 tests covering QueryType, MutationType, and SubscriptionType renderingtest/e2e.test.tsandtest/emitter.test.tswith snapshot assertions proving the full TypeSpec → mutation → classification → rendering → SDL pipeline worksTest plan
pnpm buildsucceedspnpm test— 193 tests pass