Package graphql.schema
Class GraphQLFieldDefinition.Builder
java.lang.Object
graphql.schema.GraphqlTypeBuilder<GraphQLFieldDefinition.Builder>
graphql.schema.GraphqlDirectivesContainerTypeBuilder<GraphQLFieldDefinition.Builder,GraphQLFieldDefinition.Builder>
graphql.schema.GraphQLFieldDefinition.Builder
- Enclosing class:
GraphQLFieldDefinition
@PublicApi
public static class GraphQLFieldDefinition.Builder
extends GraphqlDirectivesContainerTypeBuilder<GraphQLFieldDefinition.Builder,GraphQLFieldDefinition.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 TypeMethodDescriptionargument
(GraphQLArgument argument) argument
(GraphQLArgument.Builder builder) Same effect as the argument(GraphQLArgument).argument
(UnaryOperator<GraphQLArgument.Builder> builderFunction) Take an argument builder in a function definition and apply.argument
(List<GraphQLArgument> arguments) Deprecated.arguments
(List<GraphQLArgument> arguments) This adds the list of arguments to the field.build()
This is used to clear all the arguments in the builder so far.This is used to clear all the directives in the builder so far.dataFetcher
(DataFetcher<?> dataFetcher) Deprecated.useGraphQLCodeRegistry
insteaddataFetcherFactory
(DataFetcherFactory<?> dataFetcherFactory) Deprecated.useGraphQLCodeRegistry
insteaddefinition
(FieldDefinition definition) description
(String description) replaceArguments
(List<GraphQLArgument> arguments) replaceDirectives
(List<GraphQLDirective> directives) staticValue
(Object value) Deprecated.useGraphQLCodeRegistry
insteadtype
(GraphQLInterfaceType.Builder builder) type
(GraphQLObjectType.Builder builder) type
(GraphQLOutputType type) type
(GraphQLUnionType.Builder builder) withDirective
(GraphQLDirective directive) withDirective
(GraphQLDirective.Builder builder) withDirectives
(GraphQLDirective... directives) 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
-
type
-
type
-
type
-
type
-
dataFetcher
@Deprecated(since="2018-12-03") public GraphQLFieldDefinition.Builder dataFetcher(DataFetcher<?> dataFetcher) Deprecated.useGraphQLCodeRegistry
insteadSets theDataFetcher
to use with this field.- Parameters:
dataFetcher
- the data fetcher to use- Returns:
- this builder
-
dataFetcherFactory
@Deprecated(since="2018-12-03") public GraphQLFieldDefinition.Builder dataFetcherFactory(DataFetcherFactory<?> dataFetcherFactory) Deprecated.useGraphQLCodeRegistry
insteadSets theDataFetcherFactory
to use with this field.- Parameters:
dataFetcherFactory
- the data fetcher factory- Returns:
- this builder
-
staticValue
Deprecated.useGraphQLCodeRegistry
insteadThis will cause the data fetcher of this field to always return the supplied value- Parameters:
value
- the value to always return- Returns:
- this builder
-
argument
-
argument
public GraphQLFieldDefinition.Builder argument(UnaryOperator<GraphQLArgument.Builder> builderFunction) Take an argument builder in a function definition and apply. Can be used in a jdk8 lambda e.g.:argument(a -> a.name("argumentName"))
- Parameters:
builderFunction
- a supplier for the builder impl- Returns:
- this
-
argument
Same effect as the argument(GraphQLArgument). Builder.build() is called from within- Parameters:
builder
- an un-built/incomplete GraphQLArgument- Returns:
- this
-
argument
@Deprecated(since="2019-02-06") public GraphQLFieldDefinition.Builder argument(List<GraphQLArgument> arguments) Deprecated.This is a badly named method and is replaced byarguments(java.util.List)
This adds the list of arguments to the field.- Parameters:
arguments
- the arguments to add- Returns:
- this
-
arguments
This adds the list of arguments to the field.- Parameters:
arguments
- the arguments to add- Returns:
- this
-
replaceArguments
-
clearArguments
This is used to clear all the arguments in the builder so far.- Returns:
- the builder
-
deprecate
-
replaceDirectives
- Overrides:
replaceDirectives
in classGraphqlDirectivesContainerTypeBuilder<GraphQLFieldDefinition.Builder,
GraphQLFieldDefinition.Builder> - Parameters:
directives
- the list of directives- Returns:
- this builder
-
withDirectives
- Overrides:
withDirectives
in classGraphqlDirectivesContainerTypeBuilder<GraphQLFieldDefinition.Builder,
GraphQLFieldDefinition.Builder> - Parameters:
directives
- the variable args of directives- Returns:
- this builder
-
withDirective
- Overrides:
withDirective
in classGraphqlDirectivesContainerTypeBuilder<GraphQLFieldDefinition.Builder,
GraphQLFieldDefinition.Builder> - Parameters:
directive
- the directive to add- Returns:
- this builder
-
withDirective
- Overrides:
withDirective
in classGraphqlDirectivesContainerTypeBuilder<GraphQLFieldDefinition.Builder,
GraphQLFieldDefinition.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<GraphQLFieldDefinition.Builder,
GraphQLFieldDefinition.Builder> - Returns:
- the builder
-
name
- Overrides:
name
in classGraphqlTypeBuilder<GraphQLFieldDefinition.Builder>
-
description
- Overrides:
description
in classGraphqlTypeBuilder<GraphQLFieldDefinition.Builder>
-
build
-
arguments(java.util.List)