use of graphql.introspection.Introspection.DirectiveLocation.INTERFACE in project graphql-java by graphql-java.
the class SchemaTypeDirectivesChecker method checkTypeDirectives.
void checkTypeDirectives(List<GraphQLError> errors) {
typeRegistry.objectTypeExtensions().values().forEach(extDefinitions -> extDefinitions.forEach(ext -> checkDirectives(OBJECT, errors, ext)));
typeRegistry.interfaceTypeExtensions().values().forEach(extDefinitions -> extDefinitions.forEach(ext -> checkDirectives(INTERFACE, errors, ext)));
typeRegistry.unionTypeExtensions().values().forEach(extDefinitions -> extDefinitions.forEach(ext -> checkDirectives(UNION, errors, ext)));
typeRegistry.enumTypeExtensions().values().forEach(extDefinitions -> extDefinitions.forEach(ext -> checkDirectives(ENUM, errors, ext)));
typeRegistry.scalarTypeExtensions().values().forEach(extDefinitions -> extDefinitions.forEach(ext -> checkDirectives(SCALAR, errors, ext)));
typeRegistry.inputObjectTypeExtensions().values().forEach(extDefinitions -> extDefinitions.forEach(ext -> checkDirectives(INPUT_OBJECT, errors, ext)));
typeRegistry.getTypes(ObjectTypeDefinition.class).forEach(typeDef -> checkDirectives(OBJECT, errors, typeDef));
typeRegistry.getTypes(InterfaceTypeDefinition.class).forEach(typeDef -> checkDirectives(INTERFACE, errors, typeDef));
typeRegistry.getTypes(UnionTypeDefinition.class).forEach(typeDef -> checkDirectives(UNION, errors, typeDef));
typeRegistry.getTypes(EnumTypeDefinition.class).forEach(typeDef -> checkDirectives(ENUM, errors, typeDef));
typeRegistry.getTypes(InputObjectTypeDefinition.class).forEach(typeDef -> checkDirectives(INPUT_OBJECT, errors, typeDef));
typeRegistry.scalars().values().forEach(typeDef -> checkDirectives(SCALAR, errors, typeDef));
List<Directive> schemaDirectives = SchemaExtensionsChecker.gatherSchemaDirectives(typeRegistry, errors);
// we need to have a Node for error reporting so we make one in case there is not one
SchemaDefinition schemaDefinition = typeRegistry.schemaDefinition().orElse(SchemaDefinition.newSchemaDefinition().build());
checkDirectives(DirectiveLocation.SCHEMA, errors, typeRegistry, schemaDefinition, "schema", schemaDirectives);
Collection<DirectiveDefinition> directiveDefinitions = typeRegistry.getDirectiveDefinitions().values();
commonCheck(directiveDefinitions, errors);
}
Aggregations