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 4 times, most recently from 17e8959 to e651f96 Compare January 7, 2026 22:00
@FionaBronwen FionaBronwen force-pushed the fionabronwen/enum-typemap branch 3 times, most recently 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
@FionaBronwen FionaBronwen force-pushed the fionabronwen/enum-typemap branch 2 times, most recently from 463b824 to 398ae95 Compare January 23, 2026 21:04
@FionaBronwen FionaBronwen force-pushed the fionabronwen/enum-typemap branch from 398ae95 to 1704900 Compare January 23, 2026 21:08
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