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

Overriding cursor throws warning #152

Closed
AtithAlur opened this issue Jan 29, 2020 · 2 comments · Fixed by #173
Closed

Overriding cursor throws warning #152

AtithAlur opened this issue Jan 29, 2020 · 2 comments · Fixed by #173

Comments

@AtithAlur
Copy link

As per the documentation - https://hexdocs.pm/absinthe_relay/Absinthe.Relay.Connection.html
If we provide a :cursor argument then the value should override the internally generated cursor.
But, It's throwing a warning: [warn] Ignoring additional cursor provided on edge (overriding is not allowed)
And the warning is as per the code:

{key, _} when key in [:cursor, :node] ->

Is this an outdated document or am I doing it wrong?

@panmichal
Copy link

Looks like the possibility of overriding the default cursor was removed after a discussion: #109 (comment)

So perhaps outdated module doc.

@ronaldcurtis
Copy link
Contributor

I think there are some strong arguments for why we should have the ability to override cursors. Here is why:

  1. We could be interfacing with external services that use their own cursors. (This issue has already been raised at Custom Cursor from external endpoint #161)
  2. Currently the cursors in this package just encode the OFFSET and OFFSET + LIMIT. But we may not want to use OFFSET in our SQL queries because it results in slow performance.

I personally have a project involving both of the above issues. Is there a current workaround for overriding cursors?

benwilson512 added a commit that referenced this issue Dec 29, 2020
fix: enable overriding the default cursor for an edge [#152] [#161]
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 a pull request may close this issue.

3 participants