Package graphql.schema
Class GraphQLAppliedDirective
java.lang.Object
graphql.schema.GraphQLAppliedDirective
- All Implemented Interfaces:
GraphQLNamedSchemaElement
,GraphQLSchemaElement
An applied directive represents the instance of a directive that is applied to a schema element,
as opposed to it definition
A directive has a definition, that is what arguments it takes, and it can also be applied
to other schema elements. Originally graphql-java re-used the GraphQLDirective
and GraphQLArgument
classes to do both purposes. This was a modelling mistake. New GraphQLAppliedDirective
and GraphQLAppliedDirectiveArgument
classes have been introduced to better model when a directive is applied to a schema element,
as opposed to its schema definition itself.
See http://graphql.org/learn/queries/#directives for more details on the concept.
-
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.getArgument
(String name) The ASTNode
this schema element is based on.getName()
final int
hashCode()
No GraphQLSchemaElement implements `equals/hashCode` because we need object identity to treat a GraphQLSchema as an abstract graph.newDirective
(GraphQLAppliedDirective existing) toString()
transform
(Consumer<GraphQLAppliedDirective.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.withNewChildren
(SchemaElementChildrenContainer newChildren)
-
Field Details
-
CHILD_ARGUMENTS
- See Also:
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceGraphQLNamedSchemaElement
- Returns:
- the name of this element. This cant be null
-
getDescription
- Specified by:
getDescription
in interfaceGraphQLNamedSchemaElement
- Returns:
- the description of this element. This can be null
-
getArguments
-
getArgument
-
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.
-
toString
-
transform
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
-
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
-
accept
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor) - Specified by:
accept
in interfaceGraphQLSchemaElement
-
getChildren
- Specified by:
getChildren
in interfaceGraphQLSchemaElement
-
getChildrenWithTypeReferences
- Specified by:
getChildrenWithTypeReferences
in interfaceGraphQLSchemaElement
-
withNewChildren
- Specified by:
withNewChildren
in interfaceGraphQLSchemaElement
-
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.
-
newDirective
-
newDirective
-