All Downloads are FREE. Search and download functionalities are using the official Maven repository.

graphql.ExecutionResult Maven / Gradle / Ivy

There is a newer version: 230521-nf-execution
Show newest version
package graphql;


import java.util.List;
import java.util.Map;

/**
 * This simple value class represents the result of performing a graphql query.
 */
@PublicApi
@SuppressWarnings("TypeParameterUnusedInFormals")
public interface ExecutionResult {

    /**
     * @return the errors that occurred during execution or empty list if there is none
     */
    List getErrors();

    /**
     * @param  allows type coercion
     *
     * @return the data in the result or null if there is none
     */
     T getData();

    /**
     * @return a map of extensions or null if there are none
     */
    Map getExtensions();


    /**
     * The graphql specification says that result of a call should be a map that follows certain rules on what items
     * should be present.  Certain JSON serializers may or may interpret {@link ExecutionResult} to spec, so this method
     * is provided to produce a map that strictly follows the specification.
     *
     * See : http://facebook.github.io/graphql/#sec-Response-Format
     *
     * @return a map of the result that strictly follows the spec
     */
    Map toSpecification();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy