Class: GQLi::Mutation
Overview
Mutation node
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#__execute(client) ⇒ Object
Delegates itself to the client to be executed.
-
#to_gql ⇒ Object
Serializes to a GraphQL string.
-
#to_s ⇒ Object
Serializes to a GraphQL string.
Methods inherited from Base
#___, #__enum, #__node, #__on, #initialize
Constructor Details
This class inherits a constructor from GQLi::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class GQLi::Base
Instance Method Details
#__execute(client) ⇒ Object
Delegates itself to the client to be executed
18 19 20 |
# File 'lib/gqli/mutation.rb', line 18 def __execute(client) client.execute(self) end |
#to_gql ⇒ Object
Serializes to a GraphQL string
7 8 9 10 11 12 13 14 15 |
# File 'lib/gqli/mutation.rb', line 7 def to_gql result = <<~GQL mutation #{__name ? __name + ' ' : ''}{ #{__nodes.map(&:to_gql).join("\n")} } GQL result.lstrip end |
#to_s ⇒ Object
Serializes to a GraphQL string
23 24 25 |
# File 'lib/gqli/mutation.rb', line 23 def to_s to_gql end |