Package graphql.schema
Class GraphQLObjectType.Builder
java.lang.Object
graphql.schema.GraphqlTypeBuilder<GraphQLObjectType.Builder>
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 -
Method Summary
Modifier and TypeMethodDescriptionbuild()
This is used to clear all the directives in the builder so far.This is used to clear all the fields in the builder so far.This is used to clear all the interfaces in the builder so far.definition
(ObjectTypeDefinition definition) description
(String description) extensionDefinitions
(List<ObjectTypeExtensionDefinition> extensionDefinitions) field
(GraphQLFieldDefinition fieldDefinition) field
(GraphQLFieldDefinition.Builder builder) Same effect as the field(GraphQLFieldDefinition).field
(UnaryOperator<GraphQLFieldDefinition.Builder> builderFunction) Take a field builder in a function definition and apply.fields
(List<GraphQLFieldDefinition> fieldDefinitions) boolean
replaceDirectives
(List<GraphQLDirective> directives) replaceFields
(List<GraphQLFieldDefinition> fieldDefinitions) replaceInterfaces
(List<? extends GraphQLNamedOutputType> interfaces) withDirective
(GraphQLDirective directive) withDirective
(GraphQLDirective.Builder builder) withDirectives
(GraphQLDirective... directives) withInterface
(GraphQLInterfaceType interfaceType) withInterface
(GraphQLTypeReference reference) withInterfaces
(GraphQLInterfaceType... interfaceType) withInterfaces
(GraphQLTypeReference... references) Methods inherited from class graphql.schema.GraphqlDirectivesContainerTypeBuilder
copyExistingDirectives, replaceAppliedDirectives, withAppliedDirective, withAppliedDirective, withAppliedDirectives
Methods inherited from class graphql.schema.GraphqlTypeBuilder
comparatorRegistry
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
definition
-
extensionDefinitions
public GraphQLObjectType.Builder extensionDefinitions(List<ObjectTypeExtensionDefinition> extensionDefinitions) -
field
-
field
public GraphQLObjectType.Builder field(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
Same effect as the field(GraphQLFieldDefinition). Builder.build() is called from within- Parameters:
builder
- an un-built/incomplete GraphQLFieldDefinition- Returns:
- this
-
fields
-
replaceFields
-
clearFields
This is used to clear all the fields in the builder so far.- Returns:
- the builder
-
hasField
-
withInterface
-
replaceInterfaces
public GraphQLObjectType.Builder replaceInterfaces(List<? extends GraphQLNamedOutputType> interfaces) -
withInterface
-
withInterfaces
-
withInterfaces
-
clearInterfaces
This is used to clear all the interfaces in the builder so far.- Returns:
- the builder
-
replaceDirectives
- Overrides:
replaceDirectives
in classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,
GraphQLObjectType.Builder> - Parameters:
directives
- the list of directives- Returns:
- this builder
-
withDirectives
- Overrides:
withDirectives
in classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,
GraphQLObjectType.Builder> - Parameters:
directives
- the variable args of directives- Returns:
- this builder
-
withDirective
- Overrides:
withDirective
in classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,
GraphQLObjectType.Builder> - Parameters:
directive
- the directive to add- Returns:
- this builder
-
withDirective
- Overrides:
withDirective
in classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,
GraphQLObjectType.Builder> - Parameters:
builder
- the directive builder- Returns:
- this 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
- Overrides:
name
in classGraphqlTypeBuilder<GraphQLObjectType.Builder>
-
description
- Overrides:
description
in classGraphqlTypeBuilder<GraphQLObjectType.Builder>
-
build
-