dev: add support for lazy-loading description/deprecationReason config values#121
Merged
justlevine merged 9 commits intodevelopfrom Jun 7, 2025
Merged
dev: add support for lazy-loading description/deprecationReason config values#121justlevine merged 9 commits intodevelopfrom
description/deprecationReason config values#121justlevine merged 9 commits intodevelopfrom
Conversation
vendor-prefixed/axepress/wp-graphql-plugin-boilerplate/src/Helper/Compat.php
Show resolved
Hide resolved
vendor-prefixed/axepress/wp-graphql-plugin-boilerplate/src/Helper/Compat.php
Show resolved
Hide resolved
Member
Author
|
Validated passing locally with |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for lazy-loading GraphQL field descriptions and deprecation messages while maintaining backward compatibility. The changes update all hard-coded description values to lazy-loaded callbacks, adjust compatibility with older WPGraphQL versions via a helper method, and include minor configuration updates in composer.json, PHPStan, and PHPCS files.
Reviewed Changes
Copilot reviewed 115 out of 115 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Modules/Redirection/Type/WPObject/RedirectionSettings.php | Updated field descriptions to use lazy-loaded callbacks. |
| src/Modules/Redirection/Type/WPObject/Redirection.php | Converted description values to lazy-loaded functions. |
| src/Modules/Redirection/Type/Input/RedirectionConnectionOrderbyInput.php | Applied lazy lambda callbacks for field descriptions. |
| src/Modules/Redirection/Type/Enum/*.php | Changed enum description values to lazy-loaded versions. |
| src/Modules/Redirection/Fields/* | Updated field descriptions to lazy-loaded callbacks and added compatibility adjustments. |
| src/Modules/Redirection/Data/Loader/RedirectionsLoader.php | Added an inline comment exclusion for PHP CodeSniffer. |
| src/Modules/Redirection/Connection/RedirectionConnection.php | Introduced Compat::resolve_graphql_config for backward compatibility support. |
| src/Fields/RootQuery.php, src/Extensions/WPGraphQLWooCommerce/Type/WPObject/SeoObjects.php | Updated descriptions to lazy-loaded callbacks and adjusted compatibility usage. |
| phpstan/*.stub, phpstan.neon.dist, composer.json, .phpcs.xml.dist | Configuration updates, version bump, and adjustments to support the new lazy-loading approach. |
Comments suppressed due to low confidence (1)
src/Modules/Redirection/Connection/RedirectionConnection.php:50
- Consider expanding the inline comment with additional context or a reference so that future maintainers understand why Compat::resolve_graphql_config is applied here and when it can be removed once support for older WPGraphQL versions is dropped.
Compat::resolve_graphql_config( $config ); // @todo Remove when WPGraphQL < 2.3.0 is dropped.
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.
What
This PR as support for making
descriptionanddeprecationMessagefields lazy-loadable, while supporting backcompat.Why
Part of wp-graphql/wp-graphql#3354
How
Testing Instructions
Additional Info
A new
AxeWP\GraphQL\Helper\Compat::resolve_graphql_config()methodChecklist: