Skip to content

Commit 7bf9bbb

Browse files
committed
Finish up offsetToCursor and cursorToOffset documentation
This is a follow-up that addresses the feedback left on: #56 Namely, that: - If we're going to document `offsetToCursor`, we should document `cursorToOffset` too, for symmetry. - We should mention that cursors are supposed to be opaque.
1 parent 2e193eb commit 7bf9bbb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ resolves to the expected shape by `connectionType`.
6262
- `cursorForObjectInConnection` is a helper method that takes an array and a
6363
member object, and returns a cursor for use in the mutation payload.
6464
- `offsetToCursor` takes the index of a member object in an array and
65-
returns a cursor for use in the mutation payload.
65+
returns an opaque cursor for use in the mutation payload.
66+
- `cursorToOffset` takes an opaque cursor (created with `offsetToCursor`)
67+
and returns the corresponding array index.
6668

6769
An example usage of these methods from the [test schema](src/__tests__/starWarsSchema.js):
6870

0 commit comments

Comments
 (0)