Skip to content

Conversation

@justlevine
Copy link
Collaborator

@justlevine justlevine commented Mar 30, 2024

What does this implement/fix? Explain your changes.

This PR deprecates the following camelCased methods in AbstractConnectionResolver for their snake_cased equivalents. More specifically:

  • ::getSource() => ::get_source()
  • ::getContext() => ::get_context()
  • ::getLoader() => ::get_loader()
  • ::getInfo() => ::get_info()
  • ::getShouldExecute() => ::get_should_execute()

Does this close any currently open issues?

Part of #2749

Any relevant logs, error output, GraphiQL screenshots, etc?

Any other comments?

  • 🚨 Don't forget to replace @todo with the version number before release.

Important

As these deprecation warnings will prompt developers to update code, we should wait to merge until other changes warrant their need to edit things (e.g. prepare_* methods), such as #3088.

After #3082 is merged to develop, it might make sense to create a ConnectionResolver-specific branch, so we can group this PR with others that recommend developers update their code, so they don't need to update their child classes in multiple successive releases.

Where has this been tested?

Operating System: Ubuntu 20.04 (wsl2 + devilbox + php 8.1.15)

WordPress Version: 6.4.3

@justlevine justlevine changed the title dev: deprecate camelCased methods in AbstractConnectionResolver refactor: deprecate camelCase methods in AbstractConnectionResolver for snake_case equivalents Mar 30, 2024
@justlevine justlevine requested a review from jasonbahl March 30, 2024 13:23
@justlevine justlevine added type: enhancement Improvements to existing functionality status: blocked Progress halted due to dependencies or issues component: connections Relating to GraphQL Connections scope: code quality Refactoring, linting, and enforcing coding standards needs: reviewer response This needs the attention of a codeowner or maintainer labels Mar 30, 2024
…ling

refactor: improve `loader` handling in `AbstractConnectionResolver`
…backport/deprecate-camelcased

# Conflicts:
#	src/Data/Connection/AbstractConnectionResolver.php
@jasonbahl jasonbahl merged commit f7309af into chore/connection-resolvers-cleanup Apr 22, 2024
This was referenced Apr 22, 2024
@justlevine justlevine deleted the dev/cr2-backport/deprecate-camelcased branch April 23, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: connections Relating to GraphQL Connections needs: reviewer response This needs the attention of a codeowner or maintainer scope: code quality Refactoring, linting, and enforcing coding standards status: blocked Progress halted due to dependencies or issues type: enhancement Improvements to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants