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

fix: Fix filtering by categories and collections #136

Merged

Conversation

soniaklimas
Copy link
Contributor

@soniaklimas soniaklimas commented Dec 20, 2024

I want to merge this change because it fixes filtering by categories and collections while ensuring backward compatibility with existing attribute filtering.

Pull Request Checklist

  • Test the changes locally to ensure they work as expected.
  • Document the testing process and results in the pull request description. (Screen recording, screenshot etc)
  • Include new tests for any new functionality or significant changes.
  • Ensure that tests cover edge cases and potential failure points.
  • Document the impact of the changes on the system, including potential risks and benefits.
  • Provide a rollback plan in case the changes introduce critical issues.
  • Update documentation to reflect any changes in functionality.

@soniaklimas soniaklimas self-assigned this Dec 20, 2024
Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nimara-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 30, 2024 9:39am
nimara-ecommerce ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 30, 2024 9:39am

@@ -0,0 +1,38 @@
query SearchProductByCategoryQuery(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check this section https://graphql.org/learn/queries/#directives and extend SearchProductQuery depending on the query's argument named e.g. $searchBy = "category" | "collection" | undefined to create the query response fields dynamically. With that, you can have a single search query with many outputs depending on the URL search param instead of now 3 and having multiple if conditions in your render function. And check if you can reuse GraphQL Fragments because you've repeated in each new query the products query when it should be reused as a Fragment (stored ready-to-use Products Query).

Copy link
Collaborator

@karolkarolka karolkarolka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost done

@soniaklimas soniaklimas merged commit 152c8fa into develop Dec 30, 2024
4 checks passed
@soniaklimas soniaklimas deleted the MS-901-fix-filtering-by-categories-and-collections branch December 30, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants