use of graphql.schema.idl.errors.InterfaceFieldArgumentRedefinitionError in project graphql-java by graphql-java.
the class SchemaTypeChecker method checkArgumentConsistency.
private void checkArgumentConsistency(String typeOfType, ObjectTypeDefinition objectTypeDef, InterfaceTypeDefinition interfaceTypeDef, FieldDefinition objectFieldDef, FieldDefinition interfaceFieldDef, List<GraphQLError> errors) {
List<InputValueDefinition> objectArgs = objectFieldDef.getInputValueDefinitions();
List<InputValueDefinition> interfaceArgs = interfaceFieldDef.getInputValueDefinitions();
for (int i = 0; i < interfaceArgs.size(); i++) {
InputValueDefinition interfaceArg = interfaceArgs.get(i);
InputValueDefinition objectArg = objectArgs.get(i);
String interfaceArgStr = AstPrinter.printAst(interfaceArg);
String objectArgStr = AstPrinter.printAst(objectArg);
if (!interfaceArgStr.equals(objectArgStr)) {
errors.add(new InterfaceFieldArgumentRedefinitionError(typeOfType, objectTypeDef, interfaceTypeDef, objectFieldDef, objectArgStr, interfaceArgStr));
}
}
}
Aggregations