buildClientSchema: build enum type value maps lazily#4424
Merged
yaacovCR merged 2 commits intographql:nextfrom Aug 18, 2025
Merged
buildClientSchema: build enum type value maps lazily#4424yaacovCR merged 2 commits intographql:nextfrom
yaacovCR merged 2 commits intographql:nextfrom
Conversation
31a3c51 to
41c044c
Compare
benjie
reviewed
Jun 19, 2025
This makes definition of enum values lazy similar to how field/input field definition is lazy. It brings a small performance improvement when using enums in large schemas, as the enum values are only defined when they are actually used
41c044c to
51d617e
Compare
this PR means that bad enum value names will not be checked unless type.getValues() is called in parallel to how bad field names are not checked unless type.getFields() is called.
Contributor
Author
|
this change as implemented will result in bad enum value names not being checked unless relevant to: #4362 |
Member
|
Are they checked by the time |
Contributor
Author
|
Yes, they are. The linked issue requests earlier errors on bad names, so relevant there, but validation cannot pass with bad names. |
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 17, 2025
The option of passing a thunk was made available by: graphql#4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 17, 2025
The option of passing a thunk was made available by: graphql#4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 17, 2025
The option of passing a thunk was made available by: graphql#4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 18, 2025
The option of passing a thunk was made available by: graphql#4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 19, 2025
The option of passing a thunk was made available by: graphql#4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Dec 22, 2025
The option of passing a thunk was made available by: graphql#4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
that referenced
this pull request
Dec 22, 2025
The option of passing a thunk was made available by: #4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
that referenced
this pull request
Dec 22, 2025
The option of passing a thunk was made available by: #4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Jan 27, 2026
The option of passing a thunk was made available by: graphql#4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
that referenced
this pull request
Feb 22, 2026
The option of passing a thunk was made available by: #4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
that referenced
this pull request
Feb 23, 2026
The option of passing a thunk was made available by: #4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
The option of passing a thunk was made available by: #4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
The option of passing a thunk was made available by: #4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
The option of passing a thunk was made available by: #4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
The option of passing a thunk was made available by: #4018 . Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost:  Lazy evaluation results in bad names for enum values not being checked until `type.getValues()` is called, similar to how bad names for fields are not checked until `type.getFields()` is called. Explicit validation validates enum value names just as with field names.
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.
The option of passing a thunk was made available by: #4018 .
Always passing the thunk helps contribute to a "lazy" build process, which gives the following performance boost: