Module: ApolloFederation::HasDirectives

Instance Method Summary collapse

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_directivesObject



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_directivesObject



17
18
19
# File 'lib/apollo-federation/has_directives.rb', line 17

def own_federation_directives
  @own_federation_directives ||= []
end