Package graphql.schema
Class GraphQLInterfaceType.Builder
java.lang.Object
graphql.schema.GraphqlTypeBuilder<GraphQLInterfaceType.Builder>
graphql.schema.GraphqlDirectivesContainerTypeBuilder<GraphQLInterfaceType.Builder,GraphQLInterfaceType.Builder>
graphql.schema.GraphQLInterfaceType.Builder
- Enclosing class:
GraphQLInterfaceType
@PublicApi
@NullUnmarked
public static class GraphQLInterfaceType.Builder
extends GraphqlDirectivesContainerTypeBuilder<GraphQLInterfaceType.Builder,GraphQLInterfaceType.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.definition(InterfaceTypeDefinition definition) description(String description) extensionDefinitions(List<InterfaceTypeExtensionDefinition> 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<GraphQLInterfaceType> interfaces) replaceInterfacesOrReferences(List<? extends GraphQLNamedOutputType> interfacesOrReferences) typeResolver(TypeResolver typeResolver) Deprecated.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 GraphQLInterfaceType.Builder extensionDefinitions(List<InterfaceTypeExtensionDefinition> extensionDefinitions) -
field
-
field
public GraphQLInterfaceType.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
-
hasField
-
clearFields
This is used to clear all the fields in the builder so far.- Returns:
- the builder
-
typeResolver
@Deprecated(since="2018-12-03") public GraphQLInterfaceType.Builder typeResolver(TypeResolver typeResolver) Deprecated.- Parameters:
typeResolver- the type resolver- Returns:
- this builder
-
replaceInterfaces
-
replaceInterfacesOrReferences
public GraphQLInterfaceType.Builder replaceInterfacesOrReferences(List<? extends GraphQLNamedOutputType> interfacesOrReferences) -
withInterface
-
withInterface
-
withInterfaces
-
withInterfaces
-
replaceDirectives
- Overrides:
replaceDirectivesin classGraphqlDirectivesContainerTypeBuilder<GraphQLInterfaceType.Builder,GraphQLInterfaceType.Builder> - Parameters:
directives- the list of directives- Returns:
- this builder
-
withDirectives
- Overrides:
withDirectivesin classGraphqlDirectivesContainerTypeBuilder<GraphQLInterfaceType.Builder,GraphQLInterfaceType.Builder> - Parameters:
directives- the variable args of directives- Returns:
- this builder
-
withDirective
- Overrides:
withDirectivein classGraphqlDirectivesContainerTypeBuilder<GraphQLInterfaceType.Builder,GraphQLInterfaceType.Builder> - Parameters:
directive- the directive to add- Returns:
- this builder
-
withDirective
- Overrides:
withDirectivein classGraphqlDirectivesContainerTypeBuilder<GraphQLInterfaceType.Builder,GraphQLInterfaceType.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<GraphQLInterfaceType.Builder,GraphQLInterfaceType.Builder> - Returns:
- the builder
-
name
- Overrides:
namein classGraphqlTypeBuilder<GraphQLInterfaceType.Builder>
-
description
- Overrides:
descriptionin classGraphqlTypeBuilder<GraphQLInterfaceType.Builder>
-
build
-
GraphQLCodeRegistry.Builder.typeResolver(GraphQLInterfaceType, TypeResolver)instead