@PublicApi public class SimpleListConnection<T> extends java.lang.Object implements DataFetcher<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.
|
boolean |
isTrivialDataFetcher()
If a data fetcher is simply mapping data from an object to a field, it can be considered a trivial data fetcher for the purposes
of tracing and so on.
|
public SimpleListConnection(java.util.List<T> data, java.lang.String prefix)
public SimpleListConnection(java.util.List<T> data)
public boolean isTrivialDataFetcher()
DataFetcher
isTrivialDataFetcher
in interface DataFetcher<Connection<T>>
public Connection<T> get(DataFetchingEnvironment environment)
DataFetcher
DataFetchingEnvironment
is a composite
context object that tells you all you need to know about who 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