Skip to content

Commit dea33f9

Browse files
committed
Updated readme
1 parent 46923f2 commit dea33f9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,13 @@ Relay [specification for mutations](https://facebook.github.io/relay/graphql/mut
230230
### Connection
231231

232232
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
237240

238241
### Customizing Relay schema
239242

0 commit comments

Comments
 (0)