use of graphql.schema.idl.errors.TypeExtensionFieldRedefinitionError in project graphql-java by graphql-java.
the class SchemaTypeExtensionsChecker method checkForInputValueRedefinition.
private void checkForInputValueRedefinition(List<GraphQLError> errors, InputObjectTypeExtensionDefinition typeDefinition, List<InputValueDefinition> inputValueDefinitions, List<InputValueDefinition> referenceInputValues) {
Map<String, InputValueDefinition> referenceMap = FpKit.getByName(referenceInputValues, InputValueDefinition::getName, mergeFirst());
inputValueDefinitions.forEach(fld -> {
InputValueDefinition reference = referenceMap.get(fld.getName());
if (referenceMap.containsKey(fld.getName())) {
// ok they have the same field but is it the same type
if (!isSameType(fld.getType(), reference.getType())) {
errors.add(new TypeExtensionFieldRedefinitionError(typeDefinition, fld));
}
}
});
}
use of graphql.schema.idl.errors.TypeExtensionFieldRedefinitionError in project graphql-java by graphql-java.
the class SchemaTypeExtensionsChecker method checkForFieldRedefinition.
private void checkForFieldRedefinition(List<GraphQLError> errors, TypeDefinition typeDefinition, List<FieldDefinition> fieldDefinitions, List<FieldDefinition> referenceFieldDefinitions) {
Map<String, FieldDefinition> referenceMap = FpKit.getByName(referenceFieldDefinitions, FieldDefinition::getName, mergeFirst());
fieldDefinitions.forEach(fld -> {
FieldDefinition reference = referenceMap.get(fld.getName());
if (referenceMap.containsKey(fld.getName())) {
// ok they have the same field but is it the same type
if (!isSameType(fld.getType(), reference.getType())) {
errors.add(new TypeExtensionFieldRedefinitionError(typeDefinition, fld));
}
}
});
}
Aggregations