Skip to content

Commit

Permalink
Make Relay edge cursors easily readable using wrapper objects.
Browse files Browse the repository at this point in the history
Since relayStylePagination edges could be Reference objects, we either
need to read their properties using options.readField (like we do for
edge.node in the read function), or keep track of those properties
separately in the internal representation of the field.

This second strategy turns out to be more convenient because the merge
function sometimes needs to update the cursor associated with an edge
using information from pageInfo. Modifying other parts of the cache while
you're merging a field can be awkward, so it's simpler and cleaner to
update the cursor property of a wrapper object.
  • Loading branch information
benjamn committed Sep 16, 2020
1 parent e28b394 commit f41e9ef
Show file tree
Hide file tree
Showing 3 changed files with 562 additions and 398 deletions.
Loading

0 comments on commit f41e9ef

Please sign in to comment.