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

graphql.execution.incremental.DeferredCallContext Maven / Gradle / Ivy

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

import graphql.GraphQLError;
import graphql.Internal;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * Contains data relevant to the execution of a {@link DeferredFragmentCall}.
 * 

* The responsibilities of this class are similar to {@link graphql.execution.ExecutionContext}, but restricted to the * execution of a deferred call (instead of the whole GraphQL execution like {@link graphql.execution.ExecutionContext}). *

* Some behaviours, like error capturing, need to be scoped to a single {@link DeferredFragmentCall}, because each defer payload * contains its own distinct list of errors. */ @Internal public class DeferredCallContext { private final List errors = new CopyOnWriteArrayList<>(); public void addErrors(List errors) { this.errors.addAll(errors); } public void addError(GraphQLError graphqlError) { errors.add(graphqlError); } /** * @return a list of errors that were encountered while executing this deferred call */ public List getErrors() { return errors; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy