Package graphql.schema
Class GraphQLAppliedDirectiveArgument
java.lang.Object
graphql.schema.GraphQLAppliedDirectiveArgument
- All Implemented Interfaces:
GraphQLInputSchemaElement
,GraphQLNamedSchemaElement
,GraphQLSchemaElement
@PublicApi
public class GraphQLAppliedDirectiveArgument
extends Object
implements GraphQLNamedSchemaElement, GraphQLInputSchemaElement
This represents the argument values that can be placed on an
GraphQLAppliedDirective
.
You can think of them as 'instances' of GraphQLArgument
, when applied to a directive on a schema element
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaccept
(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor) copy()
Each GraphQLSchemaElement should make a copy of itself when this is called.final boolean
No GraphQLSchemaElement implements `equals` because we need object identity to treat a GraphQLSchema as an abstract graph.@NonNull InputValueWithState
The ASTNode
this schema element is based on.@Nullable String
This will always be null.getName()
getType()
<T> T
getValue()
This will give out an internal java value based on the semantics captured in theInputValueWithState
fromgetArgumentValue()
Note : You MUST only call this on aGraphQLAppliedDirectiveArgument
that is part of a fully formed schema.final int
hashCode()
No GraphQLSchemaElement implements `equals/hashCode` because we need object identity to treat a GraphQLSchema as an abstract graph.boolean
newArgument
(GraphQLAppliedDirectiveArgument existing) toString()
transform
(Consumer<GraphQLAppliedDirectiveArgument.Builder> builderConsumer) This helps you transform the current GraphQLArgument into another one by starting a builder with all the current values and allows you to transform it how you want.withNewChildren
(SchemaElementChildrenContainer newChildren)
-
Field Details
-
CHILD_TYPE
- See Also:
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceGraphQLNamedSchemaElement
- Returns:
- the name of this element. This cant be null
-
getType
-
hasSetValue
public boolean hasSetValue() -
getArgumentValue
- Returns:
- an input value with state for an applied directive argument
-
getValue
public <T> T getValue()This will give out an internal java value based on the semantics captured in theInputValueWithState
fromgetArgumentValue()
Note : You MUST only call this on aGraphQLAppliedDirectiveArgument
that is part of a fully formed schema. We need all the types to be resolved in order for this work correctly. Note: This method will return null if the value is not set or explicitly set to null. If you want to know the difference when "not set" and "set to null" then you can't use this method. Rather you should usegetArgumentValue()
and use theInputValueWithState.isNotSet()
methods to decide how to handle those values.- Type Parameters:
T
- the type you want it cast as- Returns:
- a value of type T which is the java value of the argument
-
getDescription
This will always be null. Applied arguments have no description- Specified by:
getDescription
in interfaceGraphQLNamedSchemaElement
- Returns:
- always null
-
getDefinition
Description copied from interface:GraphQLNamedSchemaElement
The ASTNode
this schema element is based on. Is null if the GraphQLSchema is not based on a SDL document. Some elements also have additional extension Nodes. See for exampleGraphQLObjectType.getExtensionDefinitions()
- Specified by:
getDefinition
in interfaceGraphQLNamedSchemaElement
- Returns:
- Node which this element is based on. Can be null.
-
getChildren
- Specified by:
getChildren
in interfaceGraphQLSchemaElement
-
getChildrenWithTypeReferences
- Specified by:
getChildrenWithTypeReferences
in interfaceGraphQLSchemaElement
-
withNewChildren
- Specified by:
withNewChildren
in interfaceGraphQLSchemaElement
-
copy
Description copied from interface:GraphQLSchemaElement
Each GraphQLSchemaElement should make a copy of itself when this is called. The copy should be included its current contents as they currently exist into a new object.- Specified by:
copy
in interfaceGraphQLSchemaElement
- Returns:
- a copy of this element
-
equals
No GraphQLSchemaElement implements `equals` because we need object identity to treat a GraphQLSchema as an abstract graph.- Specified by:
equals
in interfaceGraphQLSchemaElement
- Overrides:
equals
in classObject
- Parameters:
o
- the reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
hashCode
public final int hashCode()No GraphQLSchemaElement implements `equals/hashCode` because we need object identity to treat a GraphQLSchema as an abstract graph.- Specified by:
hashCode
in interfaceGraphQLSchemaElement
- Overrides:
hashCode
in classObject
- Returns:
- a hash code value for this object.
-
transform
public GraphQLAppliedDirectiveArgument transform(Consumer<GraphQLAppliedDirectiveArgument.Builder> builderConsumer) This helps you transform the current GraphQLArgument 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
-
newArgument
-
newArgument
public static GraphQLAppliedDirectiveArgument.Builder newArgument(GraphQLAppliedDirectiveArgument existing) -
accept
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor) - Specified by:
accept
in interfaceGraphQLSchemaElement
-
toString
-