Class PaginatedDataConnectionFetcher<T>

  • Type Parameters:
    T - the entity type that is paginated
    All Implemented Interfaces:
    ConnectionFetcher<T>, graphql.schema.DataFetcher<graphql.relay.Connection<T>>

    public class PaginatedDataConnectionFetcher<T>
    extends java.lang.Object
    implements ConnectionFetcher<T>
    Use this class in GraphQLConnection to do a real pagination, i.e you fetch each time the relevant data, you make the cursors and you decide if there are previous or next pages

    Note: If you are using the connection, the return type of the associated dataFetcher must implement PaginatedData

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      graphql.relay.Connection<T> get​(graphql.schema.DataFetchingEnvironment environment)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PaginatedDataConnectionFetcher

        public PaginatedDataConnectionFetcher​(graphql.schema.DataFetcher<PaginatedData<T>> paginationDataFetcher)
    • Method Detail

      • get

        public graphql.relay.Connection<T> get​(graphql.schema.DataFetchingEnvironment environment)
                                        throws java.lang.Exception
        Specified by:
        get in interface graphql.schema.DataFetcher<T>
        Throws:
        java.lang.Exception