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

Feature request: Manual offset? #280

Open
adampash opened this issue Jan 23, 2018 · 5 comments · May be fixed by #535
Open

Feature request: Manual offset? #280

adampash opened this issue Jan 23, 2018 · 5 comments · May be fixed by #535

Comments

@adampash
Copy link

adampash commented Jan 23, 2018

I've read around the issues and I understand that the join-monster way is to paginate using a relay-compliant spec if you're going to sue JM's sqlPaginate: true flag, but I'm wondering: Is there a reason not to allow for a manual offset key the same way that, e.g., limit works? E.g.,

  // ...
  limit: ({ input: { first = 20 } }) => first,
  offset: ({ input: { offset = 0 } }) => offset,
  // ...

If you were amenable to that, I'd be happy to work on a PR to add it.

Thanks,
Adam

Update: Here's a working PR with no test regressions #281

@adampash adampash changed the title Manual offset? Feature request: Manual offset? Jan 23, 2018
@renato
Copy link

renato commented Jan 25, 2018

I think this feature is essential for non-Relay users.

@adampash
Copy link
Author

adampash commented Feb 5, 2018

Sorry, I know the maintainers are probably busy, but — does this seem possible? I need to decide if I will need to maintain my own branch or not on this. :/

@flippidippi
Copy link

I would love this ability for paging with simple GraphQL with Postgres.

@mposborne
Copy link

I have made a custom MySQL dialect that includes this. Offset is included in my args so does not really require a new node property to be set but you could easily do it this way if you prefer.

Still a work in progress and largely just created for our own project but check it out to see if it will help you.

See: https://github.com/RollHQ/join-monster-mysql

@GlennMatthys
Copy link
Collaborator

I don't see any reason why this couldn't be included. But before its implementation, please discuss the API as described here: https://github.com/acarl005/join-monster/wiki/Proposal:-manual-OFFSET-LIMIT-control

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

Successfully merging a pull request may close this issue.

6 participants