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, directivesFields 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) booleanreplaceDirectives(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, withAppliedDirectivesMethods 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:
replaceDirectivesin classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder> - Parameters:
directives- the list of directives- Returns:
- this builder
-
withDirectives
- Overrides:
withDirectivesin classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder> - Parameters:
directives- the variable args of directives- Returns:
- this builder
-
withDirective
- Overrides:
withDirectivein classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder> - Parameters:
directive- the directive to add- Returns:
- this builder
-
withDirective
- Overrides:
withDirectivein classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder> - Parameters:
builder- the directive builder- Returns:
- this builder
-
clearDirectives
Description copied from class:GraphqlDirectivesContainerTypeBuilderThis is used to clear all the directives in the builder so far.- Overrides:
clearDirectivesin classGraphqlDirectivesContainerTypeBuilder<GraphQLObjectType.Builder,GraphQLObjectType.Builder> - Returns:
- the builder
-
name
- Overrides:
namein classGraphqlTypeBuilder<GraphQLObjectType.Builder>
-
description
- Overrides:
descriptionin classGraphqlTypeBuilder<GraphQLObjectType.Builder>
-
build
-