Search in sources :

Example 1 with InstrumentationValidationParameters

use of graphql.execution.instrumentation.parameters.InstrumentationValidationParameters in project graphql-java by graphql-java.

the class GraphQL method validate.

private List<ValidationError> validate(ExecutionInput executionInput, Document document, GraphQLSchema graphQLSchema, InstrumentationState instrumentationState) {
    InstrumentationContext<List<ValidationError>> validationCtx = instrumentation.beginValidation(new InstrumentationValidationParameters(executionInput, document, graphQLSchema, instrumentationState));
    Validator validator = new Validator();
    List<ValidationError> validationErrors = validator.validateDocument(graphQLSchema, document);
    validationCtx.onCompleted(validationErrors, null);
    return validationErrors;
}
Also used : List(java.util.List) ValidationError(graphql.validation.ValidationError) InstrumentationValidationParameters(graphql.execution.instrumentation.parameters.InstrumentationValidationParameters) Validator(graphql.validation.Validator)

Aggregations

InstrumentationValidationParameters (graphql.execution.instrumentation.parameters.InstrumentationValidationParameters)1 ValidationError (graphql.validation.ValidationError)1 Validator (graphql.validation.Validator)1 List (java.util.List)1