Skip to content

Conversation

@FionaBronwen
Copy link

@FionaBronwen FionaBronwen commented Jan 5, 2026

Summary

This PR introduces EnumTypeMap, a concrete implementation of the TypeMap abstraction for converting TypeSpec Enums to GraphQL EnumTypes, and refactors the registry to use it.

Changes

EnumTypeMap (src/type-maps/enum.ts):

  • Extends TypeMap<Enum, GraphQLEnumType>
  • Uses the mutated type's name as the cache key
  • Materializes GraphQL enum types from TypeSpec enums

Registry refactoring (src/registry.ts):

  • Replace inline TSPTypeContext and materialization logic with EnumTypeMap
  • addEnum() and materializeEnum() now delegate to EnumTypeMap
  • Add allRegisteredNames set for future cross-TypeMap duplicate detection

@FionaBronwen FionaBronwen force-pushed the fionabronwen/mutation-engine branch from 07d4df7 to 1f2480d Compare January 7, 2026 20:05
@FionaBronwen FionaBronwen force-pushed the fionabronwen/enum-typemap branch from 54b3fd9 to e842ba5 Compare January 7, 2026 20:05
@FionaBronwen FionaBronwen force-pushed the fionabronwen/mutation-engine branch 2 times, most recently from 7841973 to 66f0f3d Compare January 7, 2026 20:42
@FionaBronwen FionaBronwen force-pushed the fionabronwen/enum-typemap branch from e842ba5 to 2400d78 Compare January 7, 2026 20:42
@FionaBronwen FionaBronwen force-pushed the fionabronwen/mutation-engine branch from 66f0f3d to 80c468b Compare January 7, 2026 21:14
@FionaBronwen FionaBronwen force-pushed the fionabronwen/enum-typemap branch from 2400d78 to 964a436 Compare January 7, 2026 21:15
@FionaBronwen FionaBronwen force-pushed the fionabronwen/mutation-engine branch 3 times, most recently from 9f878e2 to 17e8959 Compare January 7, 2026 21:59
@FionaBronwen FionaBronwen force-pushed the fionabronwen/mutation-engine branch from 17e8959 to e651f96 Compare January 7, 2026 22:00
@FionaBronwen FionaBronwen force-pushed the fionabronwen/enum-typemap branch from 964a436 to a0c840c Compare January 8, 2026 15:11
@FionaBronwen FionaBronwen force-pushed the fionabronwen/enum-typemap branch from a0c840c to f410002 Compare January 8, 2026 15:24
@FionaBronwen FionaBronwen force-pushed the fionabronwen/enum-typemap branch from 78e20f6 to 5652caa Compare January 8, 2026 15:45
@FionaBronwen FionaBronwen marked this pull request as ready for review January 8, 2026 15:51
@FionaBronwen FionaBronwen removed the request for review from swatkatz January 8, 2026 15:51
@FionaBronwen FionaBronwen force-pushed the fionabronwen/mutation-engine branch 2 times, most recently from 04ae5e7 to 83f1ddc Compare January 15, 2026 21:09
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