@PublicApi public class GraphQLSchema extends java.lang.Object
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() |
GraphQLDirective |
getDirective(java.lang.String name) |
java.util.List<GraphQLDirective> |
getDirectives() |
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() |
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 GraphQLDirective getDirective(java.lang.String name)
public boolean isSupportingMutations()
public boolean isSupportingSubscriptions()
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