Skip to content

Conversation

@justlevine
Copy link
Collaborator

What does this implement/fix? Explain your changes.

This PR prepares the groundwork for removing deprecated parts of the codebase in WPGraphQL v3.0,

  • Moving deprecated classes into a new /deprecated directory (added by Composer ClassMap)
  • When sensible, moving deprecated GraphQL types/fields/connections into a new WPGraphQL/Deprecated.php class.
  • Updates exisiting deprecation warnings to explicitly notify that they will be removed in the next major release.

While code quality and cleanliness have always been nice - and a lot of these removals were already slated for 3.0, the impact of having this old code on agents and LLMs is becoming a major hinderance. So isolating things now and making it clearer that these things are not actually relevant to the codebase will be immediately helpful for both humans and 🤖

!NOTE
No new code has been deprecated. Only the messages on existing deprecations have been made more specific.

Does this close any currently open issues?

Any other comments?

@justlevine justlevine requested a review from Copilot August 2, 2025 22:57
Copy link
Contributor

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 prepares the WPGraphQL codebase for v3.0 by reorganizing deprecated functionality and improving deprecation warnings. The primary goal is to consolidate deprecated code and provide clearer messaging about upcoming removals to help both human developers and AI/LLM agents understand what is actually relevant in the codebase.

  • Creates a new WPGraphQL\Deprecated class to handle deprecated functionality registration
  • Moves deprecated classes to a new /deprecated directory (added to Composer classmap)
  • Updates existing deprecation warnings to explicitly mention removal in the next major version

Reviewed Changes

Copilot reviewed 40 out of 42 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/WPGraphQL.php Adds deprecated functionality initialization and removes inline deprecated filter
src/Deprecated.php New class consolidating all deprecated type and field registrations
deprecated/*.php Relocated deprecated classes with updated warning messages
src/Type/ObjectType/RootQuery.php Removes deprecated postBy field registration (moved to Deprecated class)
src/Type/ObjectType/MenuItem.php Removes deprecated connectedObject field (moved to Deprecated class)
src/Registry/TypeRegistry.php Removes deprecated union type registrations (moved to Deprecated class)
src/Model/Post.php Updates sourceUrlsBySize deprecation message
src/Router.php Moves deprecated is_graphql_request method to end of class with updated warning
composer.json Adds deprecated/ directory to classmap

@justlevine justlevine requested a review from jasonbahl August 2, 2025 23:20
@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: code quality Refactoring, linting, and enforcing coding standards labels Aug 2, 2025
@coveralls
Copy link

Coverage Status

coverage: 84.594% (+0.4%) from 84.169%
when pulling a5dff05 on AxeWP:dev/deprecation-prep
into 374c9b4 on wp-graphql:develop.

@jasonbahl
Copy link
Collaborator

Good work! Will go through more thoroughly tomorrow 🙌

@jasonbahl jasonbahl merged commit 5c1047a into wp-graphql:develop Aug 18, 2025
37 checks passed
@justlevine justlevine deleted the dev/deprecation-prep branch August 18, 2025 21:29
pull bot pushed a commit to Zezo-Ai/wp-graphql that referenced this pull request Aug 19, 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: code quality Refactoring, linting, and enforcing coding standards status: in review Awaiting review before merging or closing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants