Class: GraphQL::Autotest::Field

Inherits:
Struct
  • Object
show all
Defined in:
lib/graphql/autotest/field.rb

Constant Summary collapse

TYPE_NAME =
Field.new(name: '__typename', children: nil)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments



3
4
5
# File 'lib/graphql/autotest/field.rb', line 3

def arguments
  @arguments
end

#childrenObject

Returns the value of attribute children



3
4
5
# File 'lib/graphql/autotest/field.rb', line 3

def children
  @children
end

#nameObject

Returns the value of attribute name



3
4
5
# File 'lib/graphql/autotest/field.rb', line 3

def name
  @name
end

Instance Method Details

#to_query(root: true) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/graphql/autotest/field.rb', line 6

def to_query(root: true)
  q = _to_query
  if root
    q = "    {\n    \#{indent(q, 2)}\n    }\n    GRAPHQL\n  end\n  q\nend\n"