@PublicApi public class GraphQLSchema extends java.lang.Object
See http://graphql.org/learn/schema/#type-language for more details
Modifier and Type | Class and Description |
---|---|
static class |
GraphQLSchema.Builder |
Constructor and Description |
---|
GraphQLSchema(GraphQLObjectType queryType)
Deprecated.
use the
newSchema() builder pattern instead, as this constructor will be made private in a future version. |
GraphQLSchema(GraphQLObjectType queryType,
GraphQLObjectType mutationType,
GraphQLObjectType subscriptionType,
java.util.Set<GraphQLType> additionalTypes)
Deprecated.
use the
newSchema() builder pattern instead, as this constructor will be made private in a future version. |
GraphQLSchema(GraphQLObjectType queryType,
GraphQLObjectType mutationType,
java.util.Set<GraphQLType> additionalTypes)
Deprecated.
use the
newSchema() builder pattern instead, as this constructor will be made private in a future version. |
Modifier and Type | Method and Description |
---|---|
java.util.Set<GraphQLType> |
getAdditionalTypes() |
java.util.List<GraphQLNamedType> |
getAllTypesAsList() |
GraphQLCodeRegistry |
getCodeRegistry() |
SchemaDefinition |
getDefinition() |
java.lang.String |
getDescription() |
GraphQLDirective |
getDirective(java.lang.String name) |
java.util.Map<java.lang.String,GraphQLDirective> |
getDirectiveByName()
This returns a map of directives that are associated with this schema object including
built in ones.
|
java.util.List<GraphQLDirective> |
getDirectives()
This returns the list of directives that are associated with this schema object including
built in ones.
|
java.util.List<SchemaExtensionDefinition> |
getExtensionDefinitions() |
GraphqlFieldVisibility |
getFieldVisibility()
Deprecated.
use
GraphQLCodeRegistry.getFieldVisibility() instead |
java.util.List<GraphQLObjectType> |
getImplementations(GraphQLInterfaceType type)
This will return the list of
GraphQLObjectType types that implement the given
interface type. |
GraphQLObjectType |
getMutationType() |
GraphQLObjectType |
getObjectType(java.lang.String typeName)
Called to return a named
GraphQLObjectType from the schema |
GraphQLObjectType |
getQueryType() |
GraphQLDirective |
getSchemaDirective(java.lang.String name)
This returns the named directive that have been explicitly put on the
schema object.
|
java.util.Map<java.lang.String,GraphQLDirective> |
getSchemaDirectiveByName()
This returns a map of directives that have been explicitly put on the
schema object.
|
java.util.List<GraphQLDirective> |
getSchemaDirectives()
This returns the list of directives that have been explicitly put on the
schema object.
|
GraphQLObjectType |
getSubscriptionType() |
GraphQLType |
getType(java.lang.String typeName) |
java.util.Map<java.lang.String,GraphQLNamedType> |
getTypeMap() |
boolean |
isPossibleType(GraphQLNamedType abstractType,
GraphQLObjectType concreteType)
Returns true if a specified concrete type is a possible type of a provided abstract type.
|
boolean |
isSupportingMutations() |
boolean |
isSupportingSubscriptions() |
static GraphQLSchema.Builder |
newSchema() |
static GraphQLSchema.Builder |
newSchema(GraphQLSchema existingSchema)
This allows you to build a schema from an existing schema.
|
GraphQLSchema |
transform(java.util.function.Consumer<GraphQLSchema.Builder> builderConsumer)
This helps you transform the current GraphQLSchema object into another one by starting a builder with all
the current values and allows you to transform it how you want.
|
@Deprecated public GraphQLSchema(GraphQLObjectType queryType)
newSchema()
builder pattern instead, as this constructor will be made private in a future version.queryType
- the query type@Deprecated public GraphQLSchema(GraphQLObjectType queryType, GraphQLObjectType mutationType, java.util.Set<GraphQLType> additionalTypes)
newSchema()
builder pattern instead, as this constructor will be made private in a future version.queryType
- the query typemutationType
- the mutation typeadditionalTypes
- additional types@Deprecated public GraphQLSchema(GraphQLObjectType queryType, GraphQLObjectType mutationType, GraphQLObjectType subscriptionType, java.util.Set<GraphQLType> additionalTypes)
newSchema()
builder pattern instead, as this constructor will be made private in a future version.queryType
- the query typemutationType
- the mutation typesubscriptionType
- the subscription typeadditionalTypes
- additional typespublic GraphQLCodeRegistry getCodeRegistry()
public java.util.Set<GraphQLType> getAdditionalTypes()
public GraphQLType getType(java.lang.String typeName)
public GraphQLObjectType getObjectType(java.lang.String typeName)
GraphQLObjectType
from the schematypeName
- the name of the typeGraphQLException
- if the type is NOT a object typepublic java.util.Map<java.lang.String,GraphQLNamedType> getTypeMap()
public java.util.List<GraphQLNamedType> getAllTypesAsList()
public java.util.List<GraphQLObjectType> getImplementations(GraphQLInterfaceType type)
GraphQLObjectType
types that implement the given
interface type.type
- interface type to obtain implementations of.public boolean isPossibleType(GraphQLNamedType abstractType, GraphQLObjectType concreteType)
abstractType
- abstract type either interface or unionconcreteType
- concrete typepublic GraphQLObjectType getQueryType()
public GraphQLObjectType getMutationType()
public GraphQLObjectType getSubscriptionType()
@Deprecated public GraphqlFieldVisibility getFieldVisibility()
GraphQLCodeRegistry.getFieldVisibility()
insteadpublic java.util.List<GraphQLDirective> getDirectives()
public java.util.Map<java.lang.String,GraphQLDirective> getDirectiveByName()
public GraphQLDirective getDirective(java.lang.String name)
public java.util.List<GraphQLDirective> getSchemaDirectives()
getDirectives()
will return
directives for all schema elements, whereas this is just for the schema
element itselfpublic java.util.Map<java.lang.String,GraphQLDirective> getSchemaDirectiveByName()
getDirectives()
will return
directives for all schema elements, whereas this is just for the schema
element itselfpublic GraphQLDirective getSchemaDirective(java.lang.String name)
getDirective(String)
will return
directives for all schema elements, whereas this is just for the schema
element itselfpublic SchemaDefinition getDefinition()
public java.util.List<SchemaExtensionDefinition> getExtensionDefinitions()
public boolean isSupportingMutations()
public boolean isSupportingSubscriptions()
public java.lang.String getDescription()
public GraphQLSchema transform(java.util.function.Consumer<GraphQLSchema.Builder> builderConsumer)
builderConsumer
- the consumer code that will be given a builder to transformpublic static GraphQLSchema.Builder newSchema()
public static GraphQLSchema.Builder newSchema(GraphQLSchema existingSchema)
existingSchema
- the existing schema