Interface DirectivesContainer<T extends DirectivesContainer>

All Superinterfaces:
Node<T>, Serializable
All Known Subinterfaces:
ImplementingTypeDefinition<T>, TypeDefinition<T>
All Known Implementing Classes:
EnumTypeDefinition, EnumTypeExtensionDefinition, EnumValueDefinition, Field, FieldDefinition, FragmentDefinition, FragmentSpread, InlineFragment, InputObjectTypeDefinition, InputObjectTypeExtensionDefinition, InputValueDefinition, InterfaceTypeDefinition, InterfaceTypeExtensionDefinition, ObjectTypeDefinition, ObjectTypeExtensionDefinition, OperationDefinition, ScalarTypeDefinition, ScalarTypeExtensionDefinition, SchemaDefinition, SchemaExtensionDefinition, UnionTypeDefinition, UnionTypeExtensionDefinition, VariableDefinition

@PublicApi public interface DirectivesContainer<T extends DirectivesContainer> extends Node<T>
Represents a language node that can contain Directives. Directives can be repeatable and (by default) non repeatable.

There are access methods here that get the two different types.

See Also:
  • Method Details

    • getDirectives

      List<Directive> getDirectives()
      This will return a list of all the directives that have been put on Node as a flat list, which may contain repeatable and non repeatable directives.
      Returns:
      a list of all the directives associated with this Node
    • getDirectivesByName

      Map<String,List<Directive>> getDirectivesByName()
      This will return a Map of the all directives that are associated with a Node, including both repeatable and non repeatable directives.
      Returns:
      a map of all directives by directive name
    • getDirectives

      List<Directive> getDirectives(String directiveName)
      Returns all 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

      boolean hasDirective(String directiveName)
      This returns true if the AST node contains one or more directives by the specified name
      Parameters:
      directiveName - the name ot check
      Returns:
      true if the AST node contains one or more directives by the specified name