Skip to content

Conversation

@FionaBronwen
Copy link

@FionaBronwen FionaBronwen commented Jan 6, 2026

Summary

This PR wires up the mutation engine to the schema emitter, ensuring types are mutated before registration and materialization.

Changes

Schema emitter (src/schema-emitter.ts):

  • Initialize GraphQLMutationEngine in constructor
  • enum handler: mutates enum before registering
  • model handler: mutates model before registering
  • exitEnum/exitModel: uses cached mutated names for materialization

Flow

Original TSP

Mutation Engine

Mutated TSP

GraphQL Type Registration/ Materialization

GraphQL Schema

Example

// TypeSpec input
model $Model { 
  field: string 
}

// After mutation
model _Model { 
  field: string 
}

// GraphQL output
type _Model {
  field: String
}

@FionaBronwen FionaBronwen force-pushed the fionabronwen/model-typemap branch from ca5538e to cee34c5 Compare January 7, 2026 20:05
@FionaBronwen FionaBronwen force-pushed the fionabronwen/emitter-integration branch from b4208ef to 336b711 Compare January 7, 2026 20:06
@FionaBronwen FionaBronwen force-pushed the fionabronwen/model-typemap branch from cee34c5 to f7a355e Compare January 7, 2026 20:43
@FionaBronwen FionaBronwen force-pushed the fionabronwen/emitter-integration branch from 336b711 to ccc10f6 Compare January 7, 2026 20:43
@FionaBronwen FionaBronwen force-pushed the fionabronwen/model-typemap branch from f7a355e to fc918d4 Compare January 7, 2026 21:15
@FionaBronwen FionaBronwen force-pushed the fionabronwen/emitter-integration branch from ccc10f6 to 9c89a06 Compare January 7, 2026 21:15
@FionaBronwen FionaBronwen force-pushed the fionabronwen/model-typemap branch from fc918d4 to 5161de0 Compare January 8, 2026 16:05
@FionaBronwen FionaBronwen force-pushed the fionabronwen/emitter-integration branch 2 times, most recently from ea0893f to 803731e Compare January 8, 2026 16:42
@FionaBronwen FionaBronwen changed the title Update GraphQL Emitter to use mutation engine and model, enum TypeMaps Update GraphQL Emitter to use GraphQL Mutation Engine Jan 8, 2026
@FionaBronwen FionaBronwen force-pushed the fionabronwen/emitter-integration branch 5 times, most recently from c8143a1 to 8cd1884 Compare January 8, 2026 17:17
@FionaBronwen FionaBronwen force-pushed the fionabronwen/emitter-integration branch from 8cd1884 to c469bda Compare January 8, 2026 17:18
@FionaBronwen FionaBronwen marked this pull request as ready for review January 8, 2026 17:19
@FionaBronwen FionaBronwen removed the request for review from swatkatz January 8, 2026 17:19
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