Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter API inconsistencies #1588

Open
smthomas opened this issue Nov 16, 2020 · 8 comments
Open

Filter API inconsistencies #1588

smthomas opened this issue Nov 16, 2020 · 8 comments
Labels
Compat: Breaking Change This is a breaking change to existing functionality effort: low around a day or less Good First Issue Issue that doesn't require previous experience with WPGraphQL impact: low fix a minor issue for some people, slight QoL improvement Status: 🚀 Actionable Issues that have been curated, have enough info to take action, and are ready to be worked on Type: Enhancement New feature or request
Milestone

Comments

@smthomas
Copy link
Contributor

In the graphql_map_input_fields_to_wp_query filter, the $post_type is the last parameter. This is inconsistent with the other graphql_map_input_fields_* filters. For example in graphql_map_input_fields_to_get_terms the $taxonomy parameter is the third parameter (while the $context & $info parameters are the last two in all of the graphql_map_input_fields_* filters). For consistency sake, it may make sense to update this filter.

wp_query filter:

$query_args = apply_filters( 'graphql_map_input_fields_to_wp_query', $query_args, $where_args, $this->source, $this->args, $this->context, $this->info, $this->post_type );

get_terms filter:

$query_args = apply_filters( 'graphql_map_input_fields_to_get_terms', $query_args, $where_args, $this->taxonomy, $this->source, $this->args, $this->context, $this->info );

@smthomas smthomas added Good First Issue Issue that doesn't require previous experience with WPGraphQL Compat: Breaking Change This is a breaking change to existing functionality effort: low around a day or less impact: low fix a minor issue for some people, slight QoL improvement Status: 🚀 Actionable Issues that have been curated, have enough info to take action, and are ready to be worked on labels Nov 16, 2020
@justlevine
Copy link
Collaborator

Related: #331

@jasonbahl jasonbahl added this to the v2.0 milestone Apr 4, 2022
@justlevine justlevine added the Type: Enhancement New feature or request label Apr 28, 2022
@stale
Copy link

stale bot commented Aug 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 2, 2022
@stale
Copy link

stale bot commented Sep 2, 2022

This issue has been automatically closed because it has not had recent activity. If you believe this issue is still valid, please open a new issue and mark this as a related issue.

@stale stale bot closed this as completed Sep 2, 2022
@justlevine justlevine reopened this Sep 2, 2022
@stale stale bot removed the stale label Sep 2, 2022
@bhardie bhardie added the not stale Short-circuits stalebot. USE SPARINGLY label Dec 13, 2022
@justlevine
Copy link
Collaborator

Removing not stale, now that stalebot is behaving.

While filter consistency is still an issue, the specific inconsistencies will need to be reviewed before we can figure out an implementation plan (and what can be addressed via breaking/nonbreaking changes).

@justlevine justlevine removed the not stale Short-circuits stalebot. USE SPARINGLY label Mar 3, 2023
@tihom4537
Copy link

tihom4537 commented Dec 3, 2023

I am willing to contribute on this issue . I went through the codebase and I think I can fix it. I am bit confused if this issue is on hold or still active . I can start working on it once my doubt is cleared .

@justlevine
Copy link
Collaborator

justlevine commented Dec 3, 2023

I am willing to contribute on this issue . I went through the codebase and I think I can fix it. I am bit confused if this issue is on hold or still active . I can start working on it once my doubt is cleared .

Hey @tihom4537 , thanks so much for your offer to contribute 💪!

The issue is still valid along with the rest of #331. The reason the status is on hold is because:

  • this would be a breaking change to implement
  • the change is "low impact" (devs have access to the same params, it's just the order that should be rearranged for DX consistency)
  • There's a lot of improvements that need to be made to the Connection Resolver (exploring in refactor!: [WIP] Exploring a ConnectionResolver 2.0  #2749), which will anyways invalidate anything we do here.

Let me know if you have any further questions about this ticket or any others you might want to pick up instead. (Also feel free to ask in the #maintainers channel on Slack).

@tihom4537
Copy link

I have generated a pull request. Do consider it for the review .

@justlevine
Copy link
Collaborator

Hi @tihom4537

The effort is appreciated. However, as I mentioned above, this is currently on hold. It likely won't be merged until we start working on v2.0, and that's assuming no other changes invalidate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat: Breaking Change This is a breaking change to existing functionality effort: low around a day or less Good First Issue Issue that doesn't require previous experience with WPGraphQL impact: low fix a minor issue for some people, slight QoL improvement Status: 🚀 Actionable Issues that have been curated, have enough info to take action, and are ready to be worked on Type: Enhancement New feature or request
Projects
Status: 🛑 On Hold
Development

Successfully merging a pull request may close this issue.

6 participants