Class: WCC::Contentful::Graphql::Federation::BuildsArguments

Inherits:
Struct
  • Object
show all
Defined in:
lib/wcc/contentful/graphql/federation/builds_arguments.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argumentObject

Returns the value of attribute argument

Returns:

  • (Object)

    the current value of argument



4
5
6
# File 'lib/wcc/contentful/graphql/federation/builds_arguments.rb', line 4

def argument
  @argument
end

Class Method Details

.call(arguments) ⇒ Object



6
7
8
# File 'lib/wcc/contentful/graphql/federation/builds_arguments.rb', line 6

def self.call(arguments)
  arguments.map { |arg| new(arg).call }
end

Instance Method Details

#callObject



10
11
12
13
14
# File 'lib/wcc/contentful/graphql/federation/builds_arguments.rb', line 10

def call
  return argument if argument.is_a? GraphQL::Language::Nodes::Argument

  GraphQL::Language::Nodes::Argument.new(name: key, value: value)
end