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

Move filters for the products query into a separate input type #6498

Open
janus-reith opened this issue Jul 31, 2020 · 0 comments · May be fixed by reactioncommerce/api-plugin-products#48
Open
Labels
bug For issues that describe a defect or regression in the released software needs triage For issues that are awaiting triage by the core development team

Comments

@janus-reith
Copy link
Collaborator

Issue Description

The products query currently defines all possible filters toplevel, making it impossible to extend:
https://github.com/reactioncommerce/api-plugin-products/blob/0be4a8e31dab70475431f892b66e8ce8c3f4f6e1/src/schemas/product.graphql#L615

In comparison, this is what it looks like for the orders query:
https://github.com/reactioncommerce/api-plugin-orders/blob/419872d845d8ed24b424510fcc7e645db85cef11/src/schemas/schema.graphql#L17

OrderFilterInput can be extended easily, custom plugin logic would only need to extend the schema.

In general I believe there still is some way to go to unify these schemas and find a more generic interface for CRUD operations.

Steps to Reproduce

  1. Try to add a filter for the products filter
  2. Realize your only options are forking the plugin, or creating a custom query, duplicating the logic of the products query.

Possible Solution

Move all filters into an ProductFilterInput type.

Versions

trunk

@janus-reith janus-reith added bug For issues that describe a defect or regression in the released software needs triage For issues that are awaiting triage by the core development team labels Jul 31, 2020
@zenweasel zenweasel transferred this issue from reactioncommerce/api-plugin-products Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For issues that describe a defect or regression in the released software needs triage For issues that are awaiting triage by the core development team
Projects
Current Work
  
Specify-done
Development

Successfully merging a pull request may close this issue.

1 participant