Class: Wip::GraphqlHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/wip/helpers/graphql_helper.rb

Class Method Summary collapse

Class Method Details

.query_conditions(**args) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/wip/helpers/graphql_helper.rb', line 3

def self.query_conditions(**args)
  return "" if args.empty?
  args.collect do |k,v|
    value = v.kind_of?(String) ? "\"#{v}\"" : v
    [k, value].join(":")
  end.join(", ").yield_self{ |s| '(%s)' % s }
end