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

Backwards pagination with offsets #391

Closed
kukagg opened this issue Nov 4, 2019 · 1 comment
Closed

Backwards pagination with offsets #391

kukagg opened this issue Nov 4, 2019 · 1 comment

Comments

@kukagg
Copy link

kukagg commented Nov 4, 2019

It looks like this check for backwards pagination support doesn’t check for possibility of last and before fields even though it works fine.

L99 in /src/stringifiers/shared.js: https://github.com/acarl005/join-monster/blob/master/src/stringifiers/shared.js#L99.

Thoughts?

Issue

Query like { users(after: cursor, first: 4) } works fine but { users(before: cursor, last: 4) } doesn’t.

Solution

  if (idx(node, _ => _.args.last) && !idx(node, _ => _.args.before)) {
    throw new Error('Backward pagination not supported with offsets. Consider using keyset pagination instead')
  }

What am I missing?

@nicoabie
Copy link
Contributor

nicoabie commented May 5, 2024

New maintainer here, can you file a https://github.com/join-monster/join-monster-sscce ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants