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 booleanNo GraphQLSchemaElement implements `equals` because we need object identity to treat a GraphQLSchema as an abstract graph.@NonNull InputValueWithStateThe ASTNodethis schema element is based on.@Nullable StringThis will always be null.getName()getType()<T> TgetValue()This will give out an internal java value based on the semantics captured in theInputValueWithStatefromgetArgumentValue()Note : You MUST only call this on aGraphQLAppliedDirectiveArgumentthat is part of a fully formed schema.final inthashCode()No GraphQLSchemaElement implements `equals/hashCode` because we need object identity to treat a GraphQLSchema as an abstract graph.booleannewArgument(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:
getNamein 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 theInputValueWithStatefromgetArgumentValue()Note : You MUST only call this on aGraphQLAppliedDirectiveArgumentthat 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:
getDescriptionin interfaceGraphQLNamedSchemaElement- Returns:
- always null
-
getDefinition
Description copied from interface:GraphQLNamedSchemaElementThe ASTNodethis 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:
getDefinitionin interfaceGraphQLNamedSchemaElement- Returns:
- Node which this element is based on. Can be null.
-
getChildren
- Specified by:
getChildrenin interfaceGraphQLSchemaElement
-
getChildrenWithTypeReferences
- Specified by:
getChildrenWithTypeReferencesin interfaceGraphQLSchemaElement
-
withNewChildren
- Specified by:
withNewChildrenin interfaceGraphQLSchemaElement
-
copy
Description copied from interface:GraphQLSchemaElementEach 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:
copyin 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:
equalsin interfaceGraphQLSchemaElement- Overrides:
equalsin classObject- Parameters:
o- the reference object with which to compare.- Returns:
trueif this object is the same as the obj argument;falseotherwise.
-
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:
hashCodein interfaceGraphQLSchemaElement- Overrides:
hashCodein 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:
acceptin interfaceGraphQLSchemaElement
-
toString
-