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

Global ID "VXNlck5vZGU6MQ==" is resulting in "Error: Invalid offset cursor OffsetConnection:" #69

Closed
NICHTJ3 opened this issue May 28, 2021 · 3 comments

Comments

@NICHTJ3
Copy link
Contributor

NICHTJ3 commented May 28, 2021

My global id which actually decodes to "UserNode:1" is throwing an error due to this line. Is this logic actually correct?
https://github.com/hayes/giraphql/blob/987b78e9195d1cbfc4c6f31e6b7f37cf8f869bb2/packages/plugin-relay/src/utils/connections.ts#L104

@NICHTJ3
Copy link
Contributor Author

NICHTJ3 commented May 28, 2021

Scratch that I was trying to use the ID which of course doesn't work... It's not a cursor 🤦

@NICHTJ3 NICHTJ3 closed this as completed May 28, 2021
@NICHTJ3
Copy link
Contributor Author

NICHTJ3 commented May 28, 2021

At least this will probably help someone else come to this realization faster

@hayes
Copy link
Owner

hayes commented May 28, 2021

In some specific cases it could make sense to use IDs as cursors, but there are tons of edge cases and foot guns, so most of the time it's better to force users to use your cursors from pageInfo. You can always write your own version of the connection helpers, they are pretty simple

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

No branches or pull requests

2 participants