Class Resolver


  • public class Resolver
    extends Object
    Class representing a single method used to resolve a specific query given specific arguments. A single query can have multiple resolvers, corresponding to different combinations of arguments. This is done mainly to support attaching multiple overloaded methods as resolvers for the same query. Two resolvers of the same query must not accept the same list of argument names.
    Author:
    bojan.tomic (kaqqao)
    • Method Detail

      • resolve

        public Object resolve​(Object source,
                              Object[] args)
                       throws InvocationTargetException,
                              IllegalAccessException
        Calls the underlying resolver method/field
        Parameters:
        source - The object on which the method/field is to be called
        args - Arguments to the underlying method (empty if the underlying resolver is a field)
        Returns:
        The result returned by the underlying method/field
        Throws:
        InvocationTargetException - If a reflective invocation of the underlying method/field fails
        IllegalAccessException - If a reflective invocation of the underlying method/field is not allowed
      • getSourceTypes

        public Set<Type> getSourceTypes()
        Gets the generic Java types of the source objects (object returned by the parent query), if one is accepted by this resolver. Used to decide if this query can be nested inside another.
        Returns:
        The generic Java type of the source object, or null if this resolver does not accept one.
      • getOperationName

        public String getOperationName()
      • isBatched

        public boolean isBatched()
      • isAsync

        public boolean isAsync()
      • getOperationDescription

        public String getOperationDescription()
      • getOperationDeprecationReason

        public String getOperationDeprecationReason()
      • getRawReturnType

        public Class<?> getRawReturnType()
      • getComplexityExpression

        public String getComplexityExpression()
      • getExecutable

        public Executable<?> getExecutable()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object