Search in sources :

Example 1 with IntrospectionResultToSchema

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();
}
Also used : SchemaDefinition(graphql.language.SchemaDefinition) Document(graphql.language.Document) IntrospectionResultToSchema(graphql.introspection.IntrospectionResultToSchema)

Aggregations

IntrospectionResultToSchema (graphql.introspection.IntrospectionResultToSchema)1 Document (graphql.language.Document)1 SchemaDefinition (graphql.language.SchemaDefinition)1