Module: ApolloFederation::Interface::DefinitionMethods

Includes:
HasDirectives
Defined in:
lib/apollo-federation/interface.rb

Instance Method Summary collapse

Methods included from HasDirectives

#add_directive, #federation_directives, #own_federation_directives

Instance Method Details

#extend_typeObject



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

def extend_type
  add_directive(name: 'extends')
end

#inaccessibleObject



21
22
23
# File 'lib/apollo-federation/interface.rb', line 21

def inaccessible
  add_directive(name: 'inaccessible')
end

#key(fields:, camelize: true) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/apollo-federation/interface.rb', line 29

def key(fields:, camelize: true)
  add_directive(
    name: 'key',
    arguments: [
      name: 'fields',
      values: ApolloFederation::FieldSetSerializer.serialize(fields, camelize: camelize),
    ],
  )
end

#tag(name:) ⇒ Object



25
26
27
# File 'lib/apollo-federation/interface.rb', line 25

def tag(name:)
  add_directive(name: 'tag', arguments: [name: 'name', values: name])
end