Skip to content

Conversation

@justlevine
Copy link
Collaborator

What does this implement/fix? Explain your changes.

This PR adds the new AbstractConnectionResolver::get_is_valid_model() method, which wraps the ::is_valid_model() logic in the new graphql_connection_is_valid_model filter.

This filter is useful for developers who wish to override a Connection Resolver's is_valid_model() check. The separation of concerns helps those extending a Connection Resolver by minimizing the about of boilerplate they need to copy when overloading is_valid_model() in their child classes.

This is a non-breaking change.

Additionally, the spacing in some docblocks was cleaned up.

Does this close any currently open issues?

There are no breaking changes in this PR.

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

Any other comments?

Part of #2749

Where has this been tested?

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

WordPress Version: 6.5.2

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 1d084e8 and detected 0 issues on this pull request.

View more on Code Climate.

@justlevine justlevine added type: enhancement Improvements to existing functionality status: in review Awaiting review before merging or closing needs: reviewer response This needs the attention of a codeowner or maintainer component: connections Relating to GraphQL Connections scope: api Issues related to access functions, actions, and filters labels May 4, 2024
@justlevine justlevine requested a review from jasonbahl May 4, 2024 01:14
@coveralls
Copy link

Coverage Status

coverage: 84.332% (+0.002%) from 84.33%
when pulling 1d084e8 on justlevine:feat/get_is_valid_model
into cb18964 on wp-graphql:develop.

@jasonbahl jasonbahl merged commit 4494f9e into wp-graphql:develop May 8, 2024
@justlevine justlevine deleted the feat/get_is_valid_model branch May 8, 2024 15:47
@jasonbahl jasonbahl mentioned this pull request May 8, 2024
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: api Issues related to access functions, actions, and filters status: in review Awaiting review before merging or closing type: enhancement Improvements to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants