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, directivesFields 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.useGraphQLCodeRegistryinsteaddataFetcherFactory(DataFetcherFactory<?> dataFetcherFactory) Deprecated.useGraphQLCodeRegistryinsteaddefinition(FieldDefinition definition) description(String description) replaceArguments(List<GraphQLArgument> arguments) replaceDirectives(List<GraphQLDirective> directives) staticValue(Object value) Deprecated.useGraphQLCodeRegistryinsteadtype(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, withAppliedDirectivesMethods 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.useGraphQLCodeRegistryinsteadSets theDataFetcherto 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.useGraphQLCodeRegistryinsteadSets theDataFetcherFactoryto use with this field.- Parameters:
dataFetcherFactory- the data fetcher factory- Returns:
- this builder
-
staticValue
Deprecated.useGraphQLCodeRegistryinsteadThis 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:
replaceDirectivesin classGraphqlDirectivesContainerTypeBuilder<GraphQLFieldDefinition.Builder,GraphQLFieldDefinition.Builder> - Parameters:
directives- the list of directives- Returns:
- this builder
-
withDirectives
- Overrides:
withDirectivesin classGraphqlDirectivesContainerTypeBuilder<GraphQLFieldDefinition.Builder,GraphQLFieldDefinition.Builder> - Parameters:
directives- the variable args of directives- Returns:
- this builder
-
withDirective
- Overrides:
withDirectivein classGraphqlDirectivesContainerTypeBuilder<GraphQLFieldDefinition.Builder,GraphQLFieldDefinition.Builder> - Parameters:
directive- the directive to add- Returns:
- this builder
-
withDirective
- Overrides:
withDirectivein classGraphqlDirectivesContainerTypeBuilder<GraphQLFieldDefinition.Builder,GraphQLFieldDefinition.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<GraphQLFieldDefinition.Builder,GraphQLFieldDefinition.Builder> - Returns:
- the builder
-
name
- Overrides:
namein classGraphqlTypeBuilder<GraphQLFieldDefinition.Builder>
-
description
- Overrides:
descriptionin classGraphqlTypeBuilder<GraphQLFieldDefinition.Builder>
-
build
-
arguments(java.util.List)