lib/okay/graphql.rb in okay-6.0.0 vs lib/okay/graphql.rb in okay-7.0.0

- old
+ new

@@ -57,12 +57,12 @@ @query end end class Query - def initialize(&query) - @query = QueryDSL.new(&query) + def initialize(raw_query = nil, &query) + @query = raw_query || QueryDSL.new(&query) end def to_s "query {\n" + @query.to_s.gsub(/^/, " ") + @@ -95,11 +95,11 @@ "Authorization" => "bearer #{token}", } end end - def self.query(&query_) - Query.new(&query_) + def self.query(raw_query = nil, &query_) + Query.new(raw_query, &query_) end end end class Object