Package graphql.annotations
Class AnnotationsSchemaCreator.Builder
- java.lang.Object
-
- graphql.annotations.AnnotationsSchemaCreator.Builder
-
- Enclosing class:
- AnnotationsSchemaCreator
public static class AnnotationsSchemaCreator.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationsSchemaCreator.BuilderadditionalType(java.lang.Class<?> additionalTypeClass)Add an additional type to the additional type listAnnotationsSchemaCreator.BuilderadditionalTypes(java.util.Set<java.lang.Class<?>> additionalTypes)Add a set of additional types to the additional type lisegraphql.schema.GraphQLSchemabuild()Build a graphql schema according to the properties provided The method generates the GraphQL objects, directives, additional types, etc using the graphql annotations processor and sets them into the GraphQL SchemaAnnotationsSchemaCreator.Builderdirective(java.lang.Class<?> directiveClass)Add a directive to the graphql schema This method will generate a GraphQL Directive type out of your java class using the annotations processorAnnotationsSchemaCreator.Builderdirectives(java.lang.Class<?> directiveContainerClass)Add directive declaration class to create directives for the graphql schemaAnnotationsSchemaCreator.Builderdirectives(java.lang.Class<?>... directiveClasses)AnnotationsSchemaCreator.Builderdirectives(java.util.Set<java.lang.Class<?>> directiveClasses)Set the directives of the graphql schema This method will generate a GraphQL Directive type out of your java classes using the annotations processorGraphQLAnnotationsgetGraphQLAnnotations()AnnotationsSchemaCreator.Buildermutation(java.lang.Class<?> mutationClass)Set the Mutation of the graphql schema This method will generate a GraphQL Mutation type out of your java class using the annotations processorAnnotationsSchemaCreator.Builderquery(java.lang.Class<?> queryClass)Set the Query of the graphql schema This method will generate a GraphQL Query type out of your java class using the annotations processorAnnotationsSchemaCreator.BuildersetAlwaysPrettify(java.lang.Boolean shouldAlwaysPrettify)Set the always prettify property of the graphql annotations processor (whether or not to prettify the graphql names)AnnotationsSchemaCreator.BuildersetAnnotationsProcessor(GraphQLAnnotations annotationsProcessor)You can set your own annotations processorAnnotationsSchemaCreator.BuildersetGraphQLSchemaBuilder(graphql.schema.GraphQLSchema.Builder schemaBuilder)You can set your own schema builder, but its optionalAnnotationsSchemaCreator.BuildersetRelay(graphql.relay.Relay relay)Set the relay object in the graphql annotations processorAnnotationsSchemaCreator.Buildersubscription(java.lang.Class<?> subscriptionClass)Set the Subscription of the graphql schema This method will generate a GraphQL Subscription type out of your java class using the annotations processorAnnotationsSchemaCreator.BuildertypeExtension(java.lang.Class<?> typeExtension)Register a type extensions to the graphql processorAnnotationsSchemaCreator.BuildertypeFunction(TypeFunction typeFunction)Register a type function to the graphql processor
-
-
-
Method Detail
-
setGraphQLSchemaBuilder
public AnnotationsSchemaCreator.Builder setGraphQLSchemaBuilder(graphql.schema.GraphQLSchema.Builder schemaBuilder)
You can set your own schema builder, but its optional- Parameters:
schemaBuilder- a graphql schema builder- Returns:
- the builder after setting the schema builder
-
setAnnotationsProcessor
public AnnotationsSchemaCreator.Builder setAnnotationsProcessor(GraphQLAnnotations annotationsProcessor)
You can set your own annotations processor- Parameters:
annotationsProcessor- the annotations processor which creates the GraphQLTypes- Returns:
- the builder after setting the annotations processor
-
query
public AnnotationsSchemaCreator.Builder query(java.lang.Class<?> queryClass)
Set the Query of the graphql schema This method will generate a GraphQL Query type out of your java class using the annotations processor- Parameters:
queryClass- the Query java class- Returns:
- the builder after setting the query
-
mutation
public AnnotationsSchemaCreator.Builder mutation(java.lang.Class<?> mutationClass)
Set the Mutation of the graphql schema This method will generate a GraphQL Mutation type out of your java class using the annotations processor- Parameters:
mutationClass- the Mutation java class- Returns:
- the builder after setting the mutation
-
subscription
public AnnotationsSchemaCreator.Builder subscription(java.lang.Class<?> subscriptionClass)
Set the Subscription of the graphql schema This method will generate a GraphQL Subscription type out of your java class using the annotations processor- Parameters:
subscriptionClass- the Subscription java class- Returns:
- the builder after setting the subscription
-
directives
public AnnotationsSchemaCreator.Builder directives(java.util.Set<java.lang.Class<?>> directiveClasses)
Set the directives of the graphql schema This method will generate a GraphQL Directive type out of your java classes using the annotations processor- Parameters:
directiveClasses- a set of directive classes- Returns:
- the builder after setting the directives
-
directives
public AnnotationsSchemaCreator.Builder directives(java.lang.Class<?>... directiveClasses)
-
directives
public AnnotationsSchemaCreator.Builder directives(java.lang.Class<?> directiveContainerClass)
Add directive declaration class to create directives for the graphql schema- Parameters:
directiveContainerClass- a directive container class (directives are defined as methods inside the class)- Returns:
- the builder after adding the directive container class to the list of directive container classes
-
directive
public AnnotationsSchemaCreator.Builder directive(java.lang.Class<?> directiveClass)
Add a directive to the graphql schema This method will generate a GraphQL Directive type out of your java class using the annotations processor- Parameters:
directiveClass- a Directive java class- Returns:
- the builder after adding the directive
-
additionalType
public AnnotationsSchemaCreator.Builder additionalType(java.lang.Class<?> additionalTypeClass)
Add an additional type to the additional type list- Parameters:
additionalTypeClass- an additional type class- Returns:
- the builder after adding an additional type
-
additionalTypes
public AnnotationsSchemaCreator.Builder additionalTypes(java.util.Set<java.lang.Class<?>> additionalTypes)
Add a set of additional types to the additional type lise- Parameters:
additionalTypes- a set of additional type classes- Returns:
- the builder after adding the additional types
-
typeExtension
public AnnotationsSchemaCreator.Builder typeExtension(java.lang.Class<?> typeExtension)
Register a type extensions to the graphql processor- Parameters:
typeExtension- a type extension class- Returns:
- the builder after registering the type extension in the graphql processor
-
typeFunction
public AnnotationsSchemaCreator.Builder typeFunction(TypeFunction typeFunction)
Register a type function to the graphql processor- Parameters:
typeFunction- a type function- Returns:
- the builder after registering the type function in the graphql processor
-
setAlwaysPrettify
public AnnotationsSchemaCreator.Builder setAlwaysPrettify(java.lang.Boolean shouldAlwaysPrettify)
Set the always prettify property of the graphql annotations processor (whether or not to prettify the graphql names)- Parameters:
shouldAlwaysPrettify- a boolean flag- Returns:
- the builder after setting the property
-
setRelay
public AnnotationsSchemaCreator.Builder setRelay(graphql.relay.Relay relay)
Set the relay object in the graphql annotations processor- Parameters:
relay- a relay object- Returns:
- the builder after setting the relay object
-
getGraphQLAnnotations
public GraphQLAnnotations getGraphQLAnnotations()
- Returns:
- the graphql annotations processor
-
build
public graphql.schema.GraphQLSchema build()
Build a graphql schema according to the properties provided The method generates the GraphQL objects, directives, additional types, etc using the graphql annotations processor and sets them into the GraphQL Schema- Returns:
- a GraphQLSchema which contains generated GraphQL types out of the properties provided to the builder
-
-