Interface DataFetcher<T>

    • Method Detail

      • get

        T get​(DataFetchingEnvironment environment)
        throws java.lang.Exception
        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.
        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
        Throws:
        java.lang.Exception - to relieve the implementations from having to wrap checked exceptions. Any exception thrown from a DataFetcher will eventually be handled by the registered DataFetcherExceptionHandler and the related field will have a value of null in the result.