Skip to content

dev: add support for lazy-loading description/deprecationReason config values#121

Merged
justlevine merged 9 commits intodevelopfrom
dev/callable-types
Jun 7, 2025
Merged

dev: add support for lazy-loading description/deprecationReason config values#121
justlevine merged 9 commits intodevelopfrom
dev/callable-types

Conversation

@justlevine
Copy link
Copy Markdown
Member

@justlevine justlevine commented May 3, 2025

What

This PR as support for making description and deprecationMessage fields 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() method

Checklist:

  • My code is tested to the best of my abilities.
  • My code follows the WordPress Coding Standards.
  • My code has proper inline documentation.
  • I have added unit tests to verify the code works as intended.
  • The changes in this PR have been noted in CHANGELOG.md

Copy link
Copy Markdown

@qlty-cloud-legacy qlty-cloud-legacy bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 5004 lines exceeds the maximum allowed for the inline comments feature.

@justlevine
Copy link
Copy Markdown
Member Author

Validated passing locally with WPGraphQL v1.26.0. Will wait until the wp-graphql-plugin-boilerplate release before merging.

Copy link
Copy Markdown

@qlty-cloud-legacy qlty-cloud-legacy bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 5165 lines exceeds the maximum allowed for the inline comments feature.

@justlevine justlevine requested a review from Copilot June 7, 2025 11:42
Copy link
Copy Markdown

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.

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.

@justlevine justlevine merged commit d56ea24 into develop Jun 7, 2025
19 of 21 checks passed
@justlevine justlevine deleted the dev/callable-types branch June 7, 2025 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants