Package graphql.schema
Interface GraphQLDirectiveContainer
- All Superinterfaces:
GraphQLNamedSchemaElement,GraphQLSchemaElement
- All Known Subinterfaces:
GraphQLInputValueDefinition
- All Known Implementing Classes:
GraphQLArgument,GraphQLEnumType,GraphQLEnumValueDefinition,GraphQLFieldDefinition,GraphQLInputObjectField,GraphQLInputObjectType,GraphQLInterfaceType,GraphQLObjectType,GraphQLScalarType,GraphQLUnionType
Represents a graphql runtime type that can have
GraphQLAppliedDirectives.
Directives can be repeatable and (by default) non-repeatable.
There are access methods here that get the two different types.
The use of GraphQLDirective to represent a directive applied to an element is deprecated in favour of
GraphQLAppliedDirective. A GraphQLDirective really should represent the definition of a directive in a schema, not its use
on schema elements. However, it has been left in place for legacy reasons and will be removed in a
future version.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionThis will return a Map of the all directives that are associated with aGraphQLNamedSchemaElement, including both repeatable and non-repeatable directives.Deprecated.getAppliedDirective(String directiveName) Returns a non-repeatable directive with the provided name.This will return a list of all the directives that have been put onGraphQLNamedSchemaElementas a flat list, which may contain repeatable and non-repeatable directives.default List<GraphQLAppliedDirective> getAppliedDirectives(String directiveName) Returns all of the directives with the provided name, including repeatable and non repeatable directives.getDirective(String directiveName) Deprecated.- use theGraphQLAppliedDirectivemethods insteadDeprecated.- use theGraphQLAppliedDirectivemethods insteaddefault List<GraphQLDirective> getDirectives(String directiveName) Deprecated.- use theGraphQLAppliedDirectivemethods insteadDeprecated.- use theGraphQLAppliedDirectivemethods insteaddefault booleanhasAppliedDirective(String directiveName) This will return true if the element has a directive (repeatable or non repeatable) with the specified namedefault booleanhasDirective(String directiveName) Deprecated.usehasAppliedDirective(String)insteadMethods inherited from interface graphql.schema.GraphQLNamedSchemaElement
getDefinition, getDescription, getNameMethods inherited from interface graphql.schema.GraphQLSchemaElement
accept, copy, equals, getChildren, getChildrenWithTypeReferences, hashCode, withNewChildren
-
Field Details
-
CHILD_DIRECTIVES
- See Also:
-
CHILD_APPLIED_DIRECTIVES
- See Also:
-
-
Method Details
-
getAppliedDirectives
List<GraphQLAppliedDirective> getAppliedDirectives()This will return a list of all the directives that have been put onGraphQLNamedSchemaElementas a flat list, which may contain repeatable and non-repeatable directives.- Returns:
- a list of all the directives associated with this named schema element
-
getAllAppliedDirectivesByName
Map<String,List<GraphQLAppliedDirective>> getAllAppliedDirectivesByName()This will return a Map of the all directives that are associated with aGraphQLNamedSchemaElement, including both repeatable and non-repeatable directives.- Returns:
- a map of all directives by directive name
-
getAppliedDirective
Returns a non-repeatable directive with the provided name.- Parameters:
directiveName- the name of the directive to retrieve- Returns:
- the directive or null if there is not one with that name
-
getAppliedDirectives
Returns all of the directives with the provided name, including repeatable and non repeatable directives.- Parameters:
directiveName- the name of the directives to retrieve- Returns:
- the directives or empty list if there is not one with that name
-
hasDirective
Deprecated.usehasAppliedDirective(String)insteadThis will return true if the element has a directive (repeatable or non repeatable) with the specified name- Parameters:
directiveName- the name of the directive- Returns:
- true if there is a directive on this element with that name
-
hasAppliedDirective
This will return true if the element has a directive (repeatable or non repeatable) with the specified name- Parameters:
directiveName- the name of the directive- Returns:
- true if there is a directive on this element with that name
-
getDirectives
Deprecated.- use theGraphQLAppliedDirectivemethods insteadThis will return a list of all the directives that have been put onGraphQLNamedSchemaElementas a flat list, which may contain repeatable and non-repeatable directives.- Returns:
- a list of all the directives associated with this named schema element
-
getDirectivesByName
Deprecated.- use theGraphQLAppliedDirectivemethods insteadThis will return a Map of the non repeatable directives that are associated with aGraphQLNamedSchemaElement. Any repeatable directives will be filtered out of this map.- Returns:
- a map of non repeatable directives by directive name.
-
getAllDirectivesByName
Deprecated.- use theGraphQLAppliedDirectivemethods insteadThis will return a Map of the all directives that are associated with aGraphQLNamedSchemaElement, including both repeatable and non repeatable directives.- Returns:
- a map of all directives by directive name
-
getDirective
Deprecated.- use theGraphQLAppliedDirectivemethods insteadReturns a non-repeatable directive with the provided name. This will throw aAssertExceptionif the directive is a repeatable directive that has more then one instance.- Parameters:
directiveName- the name of the directive to retrieve- Returns:
- the directive or null if there is not one with that name
-
getDirectives
Deprecated.- use theGraphQLAppliedDirectivemethods insteadReturns all of the directives with the provided name, including repeatable and non repeatable directives.- Parameters:
directiveName- the name of the directives to retrieve- Returns:
- the directives or empty list if there is not one with that name
-
GraphQLAppliedDirectivemethods instead