Add EnumTypeMap for GraphQL enum materialization#57
Open
FionaBronwen wants to merge 2 commits intofionabronwen/mutation-enginefrom
Open
Add EnumTypeMap for GraphQL enum materialization#57FionaBronwen wants to merge 2 commits intofionabronwen/mutation-enginefrom
FionaBronwen wants to merge 2 commits intofionabronwen/mutation-enginefrom
Conversation
07d4df7 to
1f2480d
Compare
54b3fd9 to
e842ba5
Compare
7841973 to
66f0f3d
Compare
e842ba5 to
2400d78
Compare
66f0f3d to
80c468b
Compare
2400d78 to
964a436
Compare
17e8959 to
e651f96
Compare
78e20f6 to
5652caa
Compare
04ae5e7 to
83f1ddc
Compare
463b824 to
398ae95
Compare
398ae95 to
1704900
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
This PR introduces
EnumTypeMap, a concrete implementation of theTypeMapabstraction for converting TypeSpec Enums to GraphQL EnumTypes, and refactors the registry to use it.Changes
EnumTypeMap (
src/type-maps/enum.ts):TypeMap<Enum, GraphQLEnumType>Registry refactoring (src/registry.ts):
TSPTypeContextand materialization logic withEnumTypeMapaddEnum()andmaterializeEnum()now delegate toEnumTypeMapallRegisteredNamesset for future cross-TypeMap duplicate detection