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
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,10 +230,13 @@ Relay [specification for mutations](https://facebook.github.io/relay/graphql/mut
230
230
### Connection
231
231
232
232
You can use `@GraphQLConnection` annotation to make a field iterable in adherence to Relay [Connection specification](https://facebook.github.io/relay/graphql/connections.htm).\
233
-
The default connection makes you fetch ALL the data, and then builds the connections object (ie edges and nodes).\
234
-
If you want to fetch only the relevant data each time (with the "first","last","before" and "after" arguments)
235
-
you should annotate your field with `@GraphQLConnection(connection = EnhancedConnectionFetcher.class)`,
236
-
and make the associated data fetcher implement `PaginationDataFetcher`
233
+
If a field is annotated with the annotation, the associated dataFetcher must return an instance of `PaginatedData`.\
234
+
The `PaginatedData` class holds the result of the conneciton:
235
+
1. The data of the page
236
+
2. Whether or not has next page and previous page
237
+
3. A method that returns for each entity the encoded cursor of the entity (it returns string)
238
+
239
+
NOTE: because `PropertyDataFetcher` and `FieldDataFetcher` can't handle connection, this annotation cant be used on a field that doesn't have a dataFetcher
0 commit comments