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

[v0.10.0] Reverse pagination doesn't work when sorting by price / total sales #513

Closed
ardiewen opened this issue Jun 16, 2021 · 0 comments · Fixed by #522
Closed

[v0.10.0] Reverse pagination doesn't work when sorting by price / total sales #513

ardiewen opened this issue Jun 16, 2021 · 0 comments · Fixed by #522
Assignees
Labels
bug Something isn't working failing connection Issue concerns failing connection(s)
Milestone

Comments

@ardiewen
Copy link
Contributor

Describe the bug

With the release of v0.10.0, I was happy to see that upstream pagination fixes were included for products, including when sorting by numerical values such as price.

However, reverse pagination still seems to be broken when the list is sorted by numerical values such as price and total sales.

To Reproduce

Steps to reproduce the behavior:

  1. Install a fresh, minimally reproducible environment. I can email / slack a wplocal zip export of this for your reference. The only plugins installed are WooCommerce 5.4.1, WP GraphQL 1.4.2 and WooGraphQL 0.10.0

  2. I created a set of Products (Product A-F) with various prices that seemed to cause sorting issues in the past, so far so good as they are sorted properly when ascending by price:

Screen Shot 2021-06-16 at 3 58 52 PM

  1. If I keep the sort variables (by price ascending), but want to pluck the last two products before "Product D", here's what I get:

Screen Shot 2021-06-16 at 4 01 51 PM

Expected behavior

The expected result based on the query from the entire list in Step 2 should be an array of "Product G" followed by "Product C".

The same thing happens when sorting by TOTAL_SALES. As far as I can see, it may be interpreting "before" as "after" in reverse pagination. See the screenshot below for expected vs actual:

Screen Shot 2021-06-16 at 4 10 39 PM

Plugin Versions

  • WooGraphQL Version: 0.10.0
  • WPGraphQL Version: 1.4.2
  • WordPress Version: 5.7.2
  • WooCommerce Version: 5.4.1

Additional context
Add any other context about the problem here.

@kidunot89 kidunot89 self-assigned this Jun 21, 2021
@kidunot89 kidunot89 added the bug Something isn't working label Jun 21, 2021
@kidunot89 kidunot89 added this to the v0.10.1 milestone Jun 24, 2021
@kidunot89 kidunot89 added the failing connection Issue concerns failing connection(s) label Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working failing connection Issue concerns failing connection(s)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants