You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+64
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,70 @@
2
2
3
3
A Swift implementation of the [GraphQL Cursor Connections Specification](https://relay.dev/graphql/connections.htm).
4
4
5
+
## Purpose
6
+
7
+
This package provides an alternative to the pagination/connection tools provided by [Graphiti](https://github.com/GraphQLSwift/Graphiti/tree/main/Sources/Graphiti/Connection). Benefits include:
8
+
9
+
* Create your own `connection/edge` types that expose additional data
10
+
* An opaque `Cursor` type that supports identity-based or index-based cursors
11
+
* Converts GraphQL pagination model to offset pagination to give to your database, elasticsearch, etc.
12
+
* Offset pagination performs a "plus two" algorithm to efficiently calculate `hasNextPage` and `hasPreviousPage`
13
+
14
+
## Example
15
+
16
+
Add pagination to any arguments.
17
+
18
+
```swift
19
+
/// This supports forward and backward pagination. We could use `GraphForwardPaginatable` to simplify.
0 commit comments