Skip to content

Add operation components, orchestrator, and emitter rendering#84

Open
FionaBronwen wants to merge 2 commits into
fionabronwen/graphql-components-2from
fionabronwen/graphql-components-operations-wiring
Open

Add operation components, orchestrator, and emitter rendering#84
FionaBronwen wants to merge 2 commits into
fionabronwen/graphql-components-2from
fionabronwen/graphql-components-operations-wiring

Conversation

@FionaBronwen
Copy link
Copy Markdown

@FionaBronwen FionaBronwen commented Apr 21, 2026

Summary

  • Operation components: QueryType, MutationType, SubscriptionType (in components/operations/) render the three GraphQL root operation types
  • Orchestrator: components/type-collections.tsx dispatches each classified-type bucket (scalars, enums, unions, interfaces, objects, inputs) into the appropriate leaf-type component
  • Emitter wiring: rename src/emitter.tssrc/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.
  • Component tests: test/components/operation-types.test.tsx with 10 tests covering QueryType, MutationType, and SubscriptionType rendering
  • E2E tests: test/e2e.test.ts and test/emitter.test.ts with snapshot assertions proving the full TypeSpec → mutation → classification → rendering → SDL pipeline works

Test plan

@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch from 79f53c2 to 41fbefb Compare April 21, 2026 20:25
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-operations-wiring branch 2 times, most recently from 3387127 to 1a5163c Compare April 21, 2026 20:33
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch from 41fbefb to 8a187c4 Compare April 21, 2026 20:43
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-operations-wiring branch 2 times, most recently from 9e90b36 to ffc3f0f Compare April 22, 2026 17:09
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch 2 times, most recently from ffa9c95 to fe7da60 Compare April 28, 2026 15:13
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-operations-wiring branch 3 times, most recently from f73791c to ce4affb Compare April 28, 2026 15:55
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch from 618e444 to 1f7438a Compare April 28, 2026 20:56
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-operations-wiring branch from ce4affb to 98fb4f4 Compare April 28, 2026 21:21
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch 2 times, most recently from 2ef9793 to db9b099 Compare April 30, 2026 21:10
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-operations-wiring branch from 98fb4f4 to eb57da4 Compare April 30, 2026 21:10
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch from db9b099 to 6cd9324 Compare May 1, 2026 15:17
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-operations-wiring branch from eb57da4 to 2be2c50 Compare May 1, 2026 15:17
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch from 6cd9324 to 671900f Compare May 1, 2026 15:33
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-operations-wiring branch from 2be2c50 to c975212 Compare May 1, 2026 15:33
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch 2 times, most recently from 255e13b to 15743c4 Compare May 1, 2026 19:18
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.
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-operations-wiring branch from 2bd9c31 to 918f6cc Compare May 1, 2026 19:59
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.
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-operations-wiring branch from 918f6cc to cf1eb14 Compare May 1, 2026 20:04
@FionaBronwen FionaBronwen marked this pull request as ready for review May 5, 2026 15:27
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