Class: RSpec::GraphqlAssistant::QueryBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/graphql_assistant/query_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, name, input_args, resp_args) ⇒ QueryBuilder

Returns a new instance of QueryBuilder.



5
6
7
8
9
10
# File 'lib/rspec/graphql_assistant/query_builder.rb', line 5

def initialize(type, name, input_args, resp_args)
  @type = type
  @name = name
  @input_args = input_args
  @resp_args = resp_args
end

Instance Attribute Details

#input_argsObject (readonly)

Returns the value of attribute input_args.



4
5
6
# File 'lib/rspec/graphql_assistant/query_builder.rb', line 4

def input_args
  @input_args
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/rspec/graphql_assistant/query_builder.rb', line 4

def name
  @name
end

#resp_argsObject (readonly)

Returns the value of attribute resp_args.



4
5
6
# File 'lib/rspec/graphql_assistant/query_builder.rb', line 4

def resp_args
  @resp_args
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/rspec/graphql_assistant/query_builder.rb', line 4

def type
  @type
end

Instance Method Details

#callObject



13
14
15
# File 'lib/rspec/graphql_assistant/query_builder.rb', line 13

def call
  template % {type: type, name: name, input_args: transform_input_args(input_args), resp_args: transform_resp_args(resp_args)}
end