Search in sources :

Example 1 with DirectiveIllegalReferenceError

use of graphql.schema.idl.errors.DirectiveIllegalReferenceError in project graphql-java by graphql-java.

the class SchemaTypeDirectivesChecker method commonCheck.

private void commonCheck(Collection<DirectiveDefinition> directiveDefinitions, List<GraphQLError> errors) {
    directiveDefinitions.forEach(directiveDefinition -> {
        assertTypeName(directiveDefinition, errors);
        directiveDefinition.getInputValueDefinitions().forEach(inputValueDefinition -> {
            assertTypeName(inputValueDefinition, errors);
            assertExistAndIsInputType(inputValueDefinition, errors);
            if (inputValueDefinition.hasDirective(directiveDefinition.getName())) {
                errors.add(new DirectiveIllegalReferenceError(directiveDefinition, inputValueDefinition));
            }
        });
    });
}
Also used : DirectiveIllegalReferenceError(graphql.schema.idl.errors.DirectiveIllegalReferenceError)

Aggregations

DirectiveIllegalReferenceError (graphql.schema.idl.errors.DirectiveIllegalReferenceError)1