Package graphql.schema.diff
Class SchemaDiffSet
- java.lang.Object
-
- graphql.schema.diff.SchemaDiffSet
-
@PublicApi public class SchemaDiffSet extends java.lang.Object
Interface used to define 2 schemas that can be diffed by theSchemaDiff
operation.
-
-
Field Summary
Fields Modifier and Type Field Description private Document
newSchemaDoc
private Document
oldSchemaDoc
private boolean
supportsEnforcingDirectives
-
Constructor Summary
Constructors Modifier Constructor Description private
SchemaDiffSet(Document oldSchemaDoc, Document newSchemaDoc, boolean supportsEnforcingDirectives)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SchemaDiffSet
diffSetFromIntrospection(GraphQLSchema oldSchema, GraphQLSchema newSchema)
Creates an schema diff set out of the result of 2 introspection queries.static SchemaDiffSet
diffSetFromIntrospection(java.util.Map<java.lang.String,java.lang.Object> introspectionOld, java.util.Map<java.lang.String,java.lang.Object> introspectionNew)
Creates an schema diff set out of the result of 2 introspection queries.static SchemaDiffSet
diffSetFromSdl(GraphQLSchema oldSchema, GraphQLSchema newSchema)
Creates an schema diff set out of the two SDL definition Strings.static SchemaDiffSet
diffSetFromSdl(java.lang.String oldSchemaSdl, java.lang.String newSchemaSdl)
Creates an schema diff set out of the two SDL definition Strings.private static Document
getDocumentFromIntrospection(java.util.Map<java.lang.String,java.lang.Object> introspectionResult)
private static Document
getDocumentFromSDLString(java.lang.String sdlString)
Document
getNewSchemaDefinitionDoc()
Document
getOldSchemaDefinitionDoc()
private static java.lang.String
getSchemaSdl(GraphQLSchema schema)
private static java.util.Map<java.lang.String,java.lang.Object>
introspect(GraphQLSchema schema)
boolean
supportsEnforcingDirectives()
-
-
-
Method Detail
-
getOldSchemaDefinitionDoc
public Document getOldSchemaDefinitionDoc()
- Returns:
- Returns a IDL document that represents the old schema as part of a SchemaDiff operation.
-
getNewSchemaDefinitionDoc
public Document getNewSchemaDefinitionDoc()
- Returns:
- Returns a IDL document that represents the new schema created from the introspection result.
-
supportsEnforcingDirectives
public boolean supportsEnforcingDirectives()
- Returns:
- Flag indicating whether this diffset implementation can be used to enforce directives when performing schema diff.
-
diffSetFromIntrospection
public static SchemaDiffSet diffSetFromIntrospection(java.util.Map<java.lang.String,java.lang.Object> introspectionOld, java.util.Map<java.lang.String,java.lang.Object> introspectionNew)
Creates an schema diff set out of the result of 2 introspection queries.- Parameters:
introspectionOld
- the older introspection queryintrospectionNew
- the newer introspection query- Returns:
- a diff set representing them which will not support enforcing directives.
-
diffSetFromIntrospection
public static SchemaDiffSet diffSetFromIntrospection(GraphQLSchema oldSchema, GraphQLSchema newSchema)
Creates an schema diff set out of the result of 2 introspection queries.- Parameters:
oldSchema
- the older GraphQLSchema object to introspect.newSchema
- the new GraphQLSchema object to introspect.- Returns:
- a diff set representing them which will not support enforcing directives.
-
diffSetFromSdl
public static SchemaDiffSet diffSetFromSdl(java.lang.String oldSchemaSdl, java.lang.String newSchemaSdl)
Creates an schema diff set out of the two SDL definition Strings.- Parameters:
oldSchemaSdl
- the older SDL definition String.newSchemaSdl
- the newer SDL definition String.- Returns:
- a diff set representing them which will support enforcing directives.
-
diffSetFromSdl
public static SchemaDiffSet diffSetFromSdl(GraphQLSchema oldSchema, GraphQLSchema newSchema)
Creates an schema diff set out of the two SDL definition Strings.- Parameters:
oldSchema
- the older SDL definition String.newSchema
- the newer SDL definition String.- Returns:
- a diff set representing them which will support enforcing directives.
-
getDocumentFromIntrospection
private static Document getDocumentFromIntrospection(java.util.Map<java.lang.String,java.lang.Object> introspectionResult)
-
getDocumentFromSDLString
private static Document getDocumentFromSDLString(java.lang.String sdlString)
-
getSchemaSdl
private static java.lang.String getSchemaSdl(GraphQLSchema schema)
-
introspect
private static java.util.Map<java.lang.String,java.lang.Object> introspect(GraphQLSchema schema)
-
-