Package graphql.relay

Class SimpleListConnection<T>

    • Constructor Detail

      • SimpleListConnection

        public SimpleListConnection​(java.util.List<T> data,
                                    java.lang.String prefix)
      • SimpleListConnection

        public SimpleListConnection​(java.util.List<T> data)
    • Method Detail

      • get

        public Connection<T> get​(DataFetchingEnvironment environment)
        Description copied from interface: DataFetcher
        This is called by the graphql engine to fetch the value. The 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.
        Specified by:
        get in interface DataFetcher<T>
        Parameters:
        environment - this is the data fetching environment which contains all the context you need to fetch a value
        Returns:
        a value of type T. May be wrapped in a DataFetcherResult
      • cursorForObjectInConnection

        public ConnectionCursor cursorForObjectInConnection​(T object)
        find the object's cursor, or null if the object is not in this connection.
        Parameters:
        object - the object in play
        Returns:
        a connection cursor