Class: GQLi::Query
Overview
Query 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
20 21 22 |
# File 'lib/gqli/query.rb', line 20 def __execute(client) client.execute(self) end |
#to_gql ⇒ Object
Serializes to a GraphQL string
9 10 11 12 13 14 15 16 17 |
# File 'lib/gqli/query.rb', line 9 def to_gql result = <<~GQL query #{__name ? __name + ' ' : ''}{ #{__nodes.map(&:to_gql).join("\n")} } GQL result.lstrip end |
#to_s ⇒ Object
Serializes to a GraphQL string
25 26 27 |
# File 'lib/gqli/query.rb', line 25 def to_s to_gql end |