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

graphql.schema.DataFetchingEnvironment Maven / Gradle / Ivy

The newest version!
package graphql.schema;

import graphql.execution.ExecutionId;
import graphql.language.Field;
import graphql.language.FragmentDefinition;

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

/**
 * A DataFetchingEnvironment instance of passed to a {@link DataFetcher} as an execution context parameter
 */
public interface DataFetchingEnvironment {
    /**
     * @param  you decide what type it is
     *
     * @return the current object being queried
     */
     T getSource();

    /**
     * @return the arguments that have been passed in via the graphql query
     */
    Map getArguments();

    /**
     * Returns true of the named argument is present
     *
     * @param name the name of the argument
     *
     * @return true of the named argument is present
     */
    boolean containsArgument(String name);

    /**
     * Returns the named argument
     *
     * @param name the name of the argument
     * @param   you decide what type it is
     *
     * @return the named argument or null if its not [present
     */
     T getArgument(String name);

    /**
     * Returns a context argument that is set up when the {@link graphql.GraphQL#execute(String, Object)} method
     * is invoked
     *
     * @param  you decide what type it is
     *
     * @return a context object
     */
     T getContext();

    /**
     * @return the list of fields currently in query context
     */
    List getFields();

    /**
     * @return graphql type of the current field
     */
    GraphQLOutputType getFieldType();

    /**
     * @return the type of the parent of the current field
     */
    GraphQLType getParentType();

    /**
     * @return the underlying graphql schema
     */
    GraphQLSchema getGraphQLSchema();

    /**
     * @return the {@link FragmentDefinition} map for the current operation
     */
    Map getFragmentsByName();

    /**
     * @return the {@link ExecutionId} for the current operation
     */
    ExecutionId getExecutionId();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy