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 GraphQL pagination #4228

Merged
merged 2 commits into from
May 1, 2018
Merged

Conversation

aldeed
Copy link
Contributor

@aldeed aldeed commented May 1, 2018

Resolves #4227
Impact: minor
Type: bugfix

Issue

Incorrect GraphQL pagination

Solution

  • Fixed getPaginatedResponse to use the count after before/after is added to the filter, when providing count to the skip/limit function.
  • Also switched to using object format for MongoDB sort rather than array because nedb is expecting object format. This way our integration tests are actually accurate when it comes to testing anything sort-related.

Breaking changes

None

Testing

Page forward and backward through catalogItems and tags GraphQL queries and verify that the results are what you expect.

@aldeed aldeed self-assigned this May 1, 2018
@aldeed aldeed requested a review from mikemurray May 1, 2018 17:51
@aldeed aldeed force-pushed the fix-4227-aldeed-graphql-pagination branch from a6c3800 to 374ee13 Compare May 1, 2018 17:53
Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

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

LGTM. Pagination works as expected.

@mikemurray
Copy link
Member

Re-running tests before merging.

@mikemurray
Copy link
Member

Tests run and pass on CI and via ssh manually. That state isn't reflected here for some reason. merging...

@mikemurray mikemurray merged commit 85f3f86 into release-1.12.0 May 1, 2018
@mikemurray mikemurray deleted the fix-4227-aldeed-graphql-pagination branch May 1, 2018 20:38
@spencern spencern mentioned this pull request May 31, 2018
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