use of graphql.schema.idl.errors.TypeExtensionMissingBaseTypeError in project graphql-java by graphql-java.
the class SchemaTypeExtensionsChecker method checkTypeExtensionHasCorrespondingType.
private void checkTypeExtensionHasCorrespondingType(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, String name, List<? extends TypeDefinition> extTypeList, Class<? extends TypeDefinition> targetClass) {
TypeDefinition extensionDefinition = extTypeList.get(0);
Optional<? extends TypeDefinition> typeDefinition = typeRegistry.getType(new TypeName(name), targetClass);
if (!typeDefinition.isPresent()) {
errors.add(new TypeExtensionMissingBaseTypeError(extensionDefinition));
}
}
Aggregations