Package graphql.schema
Class GraphQLObjectType.Builder
- java.lang.Object
-
- graphql.schema.GraphqlTypeBuilder<BASE>
-
- graphql.schema.GraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder>
-
- graphql.schema.GraphQLObjectType.Builder
-
- Enclosing class:
- GraphQLObjectType
@PublicApi public static class GraphQLObjectType.Builder extends GraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder>
-
-
Field Summary
-
Fields inherited from class graphql.schema.GraphqlDirectivesContainerTypeBuilder
appliedDirectives, directives
-
Fields inherited from class graphql.schema.GraphqlTypeBuilder
comparatorRegistry, description, name
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(GraphQLObjectType existing)
-
Method Summary
-
Methods inherited from class graphql.schema.GraphqlDirectivesContainerTypeBuilder
copyExistingDirectives, replaceAppliedDirectives, withAppliedDirective, withAppliedDirective, withAppliedDirectives
-
Methods inherited from class graphql.schema.GraphqlTypeBuilder
comparatorRegistry
-
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(GraphQLObjectType existing)
-
-
Method Detail
-
definition
public GraphQLObjectType.Builder definition(ObjectTypeDefinition definition)
-
extensionDefinitions
public GraphQLObjectType.Builder extensionDefinitions(java.util.List<ObjectTypeExtensionDefinition> extensionDefinitions)
-
field
public GraphQLObjectType.Builder field(GraphQLFieldDefinition fieldDefinition)
-
field
public GraphQLObjectType.Builder field(java.util.function.UnaryOperator<GraphQLFieldDefinition.Builder> builderFunction)
Take a field builder in a function definition and apply. Can be used in a jdk8 lambda e.g.:field(f -> f.name("fieldName"))
- Parameters:
builderFunction
- a supplier for the builder impl- Returns:
- this
-
field
public GraphQLObjectType.Builder field(GraphQLFieldDefinition.Builder builder)
Same effect as the field(GraphQLFieldDefinition). Builder.build() is called from within- Parameters:
builder
- an un-built/incomplete GraphQLFieldDefinition- Returns:
- this
-
fields
public GraphQLObjectType.Builder fields(java.util.List<GraphQLFieldDefinition> fieldDefinitions)
-
replaceFields
public GraphQLObjectType.Builder replaceFields(java.util.List<GraphQLFieldDefinition> fieldDefinitions)
-
clearFields
public GraphQLObjectType.Builder clearFields()
This is used to clear all the fields in the builder so far.- Returns:
- the builder
-
hasField
public boolean hasField(java.lang.String fieldName)
-
withInterface
public GraphQLObjectType.Builder withInterface(GraphQLInterfaceType interfaceType)
-
replaceInterfaces
public GraphQLObjectType.Builder replaceInterfaces(java.util.List<? extends GraphQLNamedOutputType> interfaces)
-
withInterface
public GraphQLObjectType.Builder withInterface(GraphQLTypeReference reference)
-
withInterfaces
public GraphQLObjectType.Builder withInterfaces(GraphQLInterfaceType... interfaceType)
-
withInterfaces
public GraphQLObjectType.Builder withInterfaces(GraphQLTypeReference... references)
-
clearInterfaces
public GraphQLObjectType.Builder clearInterfaces()
This is used to clear all the interfaces in the builder so far.- Returns:
- the builder
-
replaceDirectives
public GraphQLObjectType.Builder replaceDirectives(java.util.List<GraphQLDirective> directives)
- Overrides:
replaceDirectives
in classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder>
- Parameters:
directives
- the list of directives- Returns:
- this builder
-
withDirectives
public GraphQLObjectType.Builder withDirectives(GraphQLDirective... directives)
- Overrides:
withDirectives
in classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder>
- Parameters:
directives
- the variable args of directives- Returns:
- this builder
-
withDirective
public GraphQLObjectType.Builder withDirective(GraphQLDirective directive)
- Overrides:
withDirective
in classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder>
- Parameters:
directive
- the directive to add- Returns:
- this builder
-
withDirective
public GraphQLObjectType.Builder withDirective(GraphQLDirective.Builder builder)
- Overrides:
withDirective
in classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder>
- Parameters:
builder
- the directive builder- Returns:
- this builder
-
clearDirectives
public GraphQLObjectType.Builder clearDirectives()
Description copied from class:GraphqlDirectivesContainerTypeBuilder
This is used to clear all the directives in the builder so far.- Overrides:
clearDirectives
in classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder>
- Returns:
- the builder
-
name
public GraphQLObjectType.Builder name(java.lang.String name)
- Overrides:
name
in classGraphqlTypeBuilder<GraphQLObjectType.Builder>
-
description
public GraphQLObjectType.Builder description(java.lang.String description)
- Overrides:
description
in classGraphqlTypeBuilder<GraphQLObjectType.Builder>
-
build
public GraphQLObjectType build()
-
-