Package graphql.execution.directives
Class QueryAppliedDirective
- java.lang.Object
-
- graphql.execution.directives.QueryAppliedDirective
-
@PublicApi public class QueryAppliedDirective extends java.lang.Object
An applied directive represents the instance of a directive that is applied to a query element such as a field or fragment.Originally graphql-java re-used the
GraphQLDirective
andGraphQLArgument
classes to do both purposes. This was a modelling mistake. NewQueryAppliedDirective
andQueryAppliedDirectiveArgument
classes have been introduced to better model when a directive is applied to a query element, as opposed to its schema definition itself.See https://graphql.org/learn/queries/#directives for more details on the concept.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QueryAppliedDirective.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable QueryAppliedDirectiveArgument
getArgument(java.lang.String name)
java.util.List<QueryAppliedDirectiveArgument>
getArguments()
@Nullable Directive
getDefinition()
@Nullable java.lang.String
getDescription()
@NotNull java.lang.String
getName()
static QueryAppliedDirective.Builder
newDirective()
static QueryAppliedDirective.Builder
newDirective(QueryAppliedDirective existing)
java.lang.String
toString()
QueryAppliedDirective
transform(java.util.function.Consumer<QueryAppliedDirective.Builder> builderConsumer)
This helps you transform the current GraphQLDirective into another one by starting a builder with all the current values and allows you to transform it how you want.
-
-
-
Method Detail
-
getName
@NotNull public @NotNull java.lang.String getName()
-
getDescription
@Nullable public @Nullable java.lang.String getDescription()
-
getArguments
public java.util.List<QueryAppliedDirectiveArgument> getArguments()
-
getArgument
@Nullable public @Nullable QueryAppliedDirectiveArgument getArgument(java.lang.String name)
-
getDefinition
@Nullable public @Nullable Directive getDefinition()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
transform
public QueryAppliedDirective transform(java.util.function.Consumer<QueryAppliedDirective.Builder> builderConsumer)
This helps you transform the current GraphQLDirective into another one by starting a builder with all the current values and allows you to transform it how you want.- Parameters:
builderConsumer
- the consumer code that will be given a builder to transform- Returns:
- a new field based on calling build on that builder
-
newDirective
public static QueryAppliedDirective.Builder newDirective()
-
newDirective
public static QueryAppliedDirective.Builder newDirective(QueryAppliedDirective existing)
-
-