@PublicApi public class SimpleListConnection<T> extends java.lang.Object implements DataFetcher<Connection<T>>, TrivialDataFetcher<Connection<T>>
Constructor and Description |
---|
SimpleListConnection(java.util.List<T> data) |
SimpleListConnection(java.util.List<T> data,
java.lang.String prefix) |
Modifier and Type | Method and Description |
---|---|
ConnectionCursor |
cursorForObjectInConnection(T object)
find the object's cursor, or null if the object is not in this connection.
|
Connection<T> |
get(DataFetchingEnvironment environment)
This is called by the graphql engine to fetch the value.
|
public SimpleListConnection(java.util.List<T> data, java.lang.String prefix)
public SimpleListConnection(java.util.List<T> data)
public Connection<T> get(DataFetchingEnvironment environment)
DataFetcher
DataFetchingEnvironment
is a composite
context object that tells you all you need to know about how to fetch a data value in graphql type terms.get
in interface DataFetcher<Connection<T>>
environment
- this is the data fetching environment which contains all the context you need to fetch a valueDataFetcherResult
public ConnectionCursor cursorForObjectInConnection(T object)
object
- the object in play