Expose "key" for each record #230
jono-allen
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are using graphql on top of eletrodb which has been working great, we are having some issues regarding relay pagination.
The relay spec requires a
cursor
for each record and anendCursor
for each edge.Eletrodb's
cursor
works for theendCursor
but there is no way to get the cursor for each record.Our workaround for this is to manually re-create the
cursor
for each record returned from the query by providingdata: 'includeKeys'
and then constructing acursor
for the relay to match the pattern of the Eletrodbs cursor.The issue arises when the query doesn't use the primary index, and we then need to provide other keys to the cursor but it's not easy to work out which other index key to provide.
It would be great if eletrodb had an option to expose a key for each record that matches the eletrodbs cursor key for the current index being queried.
This key then could be provided as the
cursor
for the relay edge.Beta Was this translation helpful? Give feedback.
All reactions