Skip to content

Conversation

justlevine
Copy link
Collaborator

@justlevine justlevine commented May 2, 2025

What does this implement/fix? Explain your changes.

This PR improves the type hinting inside WPEnumType to use explicit array shapes instead of mixed whenever possible, all the way through to the register_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.

Copy link

Code Climate has analyzed commit aac3dc3 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3

View more on Code Climate.

@justlevine justlevine requested review from jasonbahl and Copilot May 2, 2025 21:02
Copy link
Contributor

@Copilot Copilot AI left a 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

@justlevine justlevine added status: in review Awaiting review before merging or closing needs: reviewer response This needs the attention of a codeowner or maintainer scope: api Issues related to access functions, actions, and filters type: chore Maintenance tasks, refactoring, and other non-functional changes labels May 2, 2025
@jasonbahl jasonbahl merged commit 676d267 into wp-graphql:develop May 5, 2025
39 of 40 checks passed
@justlevine justlevine deleted the chore/enum-config-shapes branch May 5, 2025 16:58
pull bot pushed a commit to Zezo-Ai/wp-graphql that referenced this pull request 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants