-
Notifications
You must be signed in to change notification settings - Fork 463
chore: expose array shapes for register_graphql_enum_type() $config #3373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jasonbahl
merged 6 commits into
wp-graphql:develop
from
justlevine:chore/enum-config-shapes
May 5, 2025
Merged
chore: expose array shapes for register_graphql_enum_type() $config #3373
jasonbahl
merged 6 commits into
wp-graphql:develop
from
justlevine:chore/enum-config-shapes
May 5, 2025
Conversation
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
Code Climate has analyzed commit aac3dc3 and detected 3 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 22 changed files in this pull request and generated no comments.
Files not reviewed (20)
- access-functions.php: Language not supported
- src/AppContext.php: Language not supported
- src/Data/Connection/AbstractConnectionResolver.php: Language not supported
- src/Data/DataSource.php: Language not supported
- src/Data/Loader/AbstractDataLoader.php: Language not supported
- src/Registry/TypeRegistry.php: Language not supported
- src/Request.php: Language not supported
- src/Router.php: Language not supported
- src/Server/ValidationRules/QueryDepth.php: Language not supported
- src/Server/WPHelper.php: Language not supported
- src/Type/Enum/ContentNodeIdTypeEnum.php: Language not supported
- src/Type/Enum/PluginStatusEnum.php: Language not supported
- src/Type/Enum/PostStatusEnum.php: Language not supported
- src/Type/Enum/TermNodeIdTypeEnum.php: Language not supported
- src/Type/Enum/UserNodeIdTypeEnum.php: Language not supported
- src/Type/WPEnumType.php: Language not supported
- src/Utils/InstrumentSchema.php: Language not supported
- src/Utils/QueryAnalyzer.php: Language not supported
- src/Utils/QueryLog.php: Language not supported
- src/Utils/Tracing.php: Language not supported
jasonbahl
approved these changes
May 5, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
needs: reviewer response
This needs the attention of a codeowner or maintainer
scope: api
Issues related to access functions, actions, and filters
status: in review
Awaiting review before merging or closing
type: chore
Maintenance tasks, refactoring, and other non-functional changes
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.
What does this implement/fix? Explain your changes.
This PR improves the type hinting inside
WPEnumType
to use explicit array shapes instead ofmixed
whenever possible, all the way through to theregister_graphql_enum_type()
config array.Additionally, some complexity was removed via early returns, and the
PostStatusEnum
was refactored to fix a missing description.Important
This pr is based on #3368 which should be merged first.
Relevant diff: aac3dc3
Does this close any currently open issues?
Nope
Any other comments?
As part of #3354, we can update values to support a callable too, but it will take care to preserve the filters.