Class RequestAwareDataFetcher<T>

  • All Implemented Interfaces:
    graphql.schema.DataFetcher<T>
    Direct Known Subclasses:
    ContentTypeBasedDataFetcher, UrlTransformDataFetcher

    public abstract class RequestAwareDataFetcher<T>
    extends Object
    implements graphql.schema.DataFetcher<T>
    Base implementation for DataFetcher that set's the current RequestContext before actually resolving the requested fields.
    Since:
    3.1.1
    Author:
    joseross
    • Constructor Detail

      • RequestAwareDataFetcher

        public RequestAwareDataFetcher()
    • Method Detail

      • get

        public T get​(graphql.schema.DataFetchingEnvironment environment)
              throws Exception
        Specified by:
        get in interface graphql.schema.DataFetcher<T>
        Throws:
        Exception
      • doGet

        public abstract T doGet​(graphql.schema.DataFetchingEnvironment environment)
                         throws Exception
        Performs the actual fetching of the requested fields.
        Parameters:
        environment - the DataFetchingEnvironment
        Returns:
        the resolved value
        Throws:
        Exception - if there is any error resolving the requested field