Class AbstractSortStrategy

java.lang.Object
org.springframework.graphql.data.query.AbstractSortStrategy
All Implemented Interfaces:
SortStrategy

public abstract class AbstractSortStrategy extends Object implements SortStrategy
Convenient base class for a SortStrategy. Subclasses help to extract the list of sort properties and direction.
Since:
1.2.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • AbstractSortStrategy

      public AbstractSortStrategy()
  • Method Details

    • extract

      public org.springframework.data.domain.Sort extract(DataFetchingEnvironment environment)
      Description copied from interface: SortStrategy
      Return a Sort instance by extracting the sort information from GraphQL arguments, or Sort.unsorted() otherwise.
      Specified by:
      extract in interface SortStrategy
    • getProperties

      protected abstract List<String> getProperties(DataFetchingEnvironment environment)
      Return the sort properties to use, or an empty list if there are none.
    • getDirection

      @Nullable protected abstract org.springframework.data.domain.Sort.Direction getDirection(DataFetchingEnvironment environment)
      Return the sort direction to use, or null.