use of graphql.SerializationError in project graphql-java by graphql-java.
the class ExecutionResultJSONTesting method createER.
private ExecutionResult createER() {
List<GraphQLError> errors = new ArrayList<>();
errors.add(new ValidationError(ValidationErrorType.UnknownType, mkLocations(), "Test ValidationError"));
errors.add(new MissingRootTypeException("Mutations are not supported.", null));
errors.add(new InvalidSyntaxError(mkLocations(), "Not good syntax m'kay"));
errors.add(new NonNullableFieldWasNullError(new NonNullableFieldWasNullException(mkTypeInfo(), mkPath())));
errors.add(new SerializationError(mkPath(), new CoercingSerializeException("Bad coercing")));
errors.add(new ExceptionWhileDataFetching(mkPath(), new RuntimeException("Bang"), mkLocation(666, 999)));
return new ExecutionResultImpl(null, errors);
}
use of graphql.SerializationError in project graphql-java by graphql-java.
the class ExecutionStrategy method handleCoercionProblem.
@SuppressWarnings("SameReturnValue")
private Object handleCoercionProblem(ExecutionContext context, ExecutionStrategyParameters parameters, CoercingSerializeException e) {
SerializationError error = new SerializationError(parameters.getPath(), e);
log.warn(error.getMessage(), e);
context.addError(error);
parameters.deferredErrorSupport().onError(error);
return null;
}
Aggregations