class GQLi::Query

Query node

Public Instance Methods

__execute(client) click to toggle source

Delegates itself to the client to be executed

# File lib/gqli/query.rb, line 20
def __execute(client)
  client.execute(self)
end
to_gql() click to toggle source

Serializes to a GraphQL string

# 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() click to toggle source

Serializes to a GraphQL string

# File lib/gqli/query.rb, line 25
def to_s
  to_gql
end