use of graphql.introspection.IntrospectionResultToSchema in project graphql-java by graphql-java.
the class SchemaDiff method diffSchemaImpl.
private void diffSchemaImpl(DiffSet diffSet, DifferenceReporter reporter) {
Map<String, Object> oldApi = diffSet.getOld();
Map<String, Object> newApi = diffSet.getNew();
Document oldDoc = new IntrospectionResultToSchema().createSchemaDefinition(oldApi);
Document newDoc = new IntrospectionResultToSchema().createSchemaDefinition(newApi);
DiffCtx ctx = new DiffCtx(reporter, oldDoc, newDoc);
Optional<SchemaDefinition> oldSchemaDef = getSchemaDef(oldDoc);
Optional<SchemaDefinition> newSchemaDef = getSchemaDef(newDoc);
// check query operation
checkOperation(ctx, "query", oldSchemaDef, newSchemaDef);
checkOperation(ctx, "mutation", oldSchemaDef, newSchemaDef);
checkOperation(ctx, "subscription", oldSchemaDef, newSchemaDef);
reporter.onEnd();
}
Aggregations