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: [WIP] unstable term cursor identical names #2930
fix: [WIP] unstable term cursor identical names #2930
Conversation
wp-graphql#2926 Terms cursor now handles identical names accurately with asc/desc and after/before.
Code Climate has analyzed commit dfca9ab and detected 0 issues on this pull request. View more on Code Climate. |
…v1.17.0 # Conflicts: # src/WPGraphQL.php
release: v1.17.0
@mohjak I've confirmed that the changes work when testing locally. I'll take a look at the menu tests 👀 and also ensure we have proper tests for term queries to account for these changes. |
…s to fail - @todo: add tests to cover the original issue scenario: paginating terms that have the same name and the query orders by name
@mohjak I pulled down your branch to see if I could diagnose why the 2 tests are failing. It seems that this change is causing the tests to fail. I added it back and the tests pass. Below is an overview of the behavior I'm experiencing now. Similar to your scenario, I've created a category with several child categories, and I've given all the children the same name "Child 1" BEFORE:Query for the first 3 categories that are children of Use the cursor for Expectation: see 3 more categories that are children of Actual: No results: AFTER:Now, with this PR (your changes + my change to add back the previously removed code)... Query for the first 3 categories that are children of Now, we can take the cursor for Expectation: See categories Actual: see categories |
@mohjak I pushed some commits to fix a broken test unrelated to this feature (the akismet plugin had a name change that was causing some plugin query tests to fail) If you could confirm that this fixes the issue(s) you were running into, that would be great 🙏🏻 |
What does this implement/fix? Explain your changes.
This is mainly stabilizing the term cursor when there are more than one term have the same term name.
Does this close any currently open issues?
relates to #2926 but it doesn't close it because there are 2 failed tests after applying the changes:
EDIT:
closes: #2926
The above tests have been fixed. see: #2930 (comment)