Module: ApolloFederation::HasDirectives
- Included in:
- Argument, Enum::ClassMethods, EnumValue, Field, InputObject::ClassMethods, Interface::DefinitionMethods, Object::ClassMethods, Scalar::ClassMethods, Union::ClassMethods
- Defined in:
- lib/apollo-federation/has_directives.rb
Instance Method Summary collapse
- #add_directive(name:, arguments: nil) ⇒ Object
- #federation_directives ⇒ Object
- #own_federation_directives ⇒ Object
Instance Method Details
#add_directive(name:, arguments: nil) ⇒ Object
5 6 7 |
# File 'lib/apollo-federation/has_directives.rb', line 5 def add_directive(name:, arguments: nil) own_federation_directives << { name: name, arguments: arguments } end |
#federation_directives ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/apollo-federation/has_directives.rb', line 9 def federation_directives if is_a?(Class) own_federation_directives + find_inherited_value(:federation_directives, []) else own_federation_directives end end |
#own_federation_directives ⇒ Object
17 18 19 |
# File 'lib/apollo-federation/has_directives.rb', line 17 def own_federation_directives @own_federation_directives ||= [] end |