activegraphql 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51dcb23f45f29333e407e55f8777e95f3c1c985e
4
- data.tar.gz: 32d4de12dcbe4472053d8b3396297fcaa1357526
3
+ metadata.gz: ab84b9f3584d4df9c5853fa08e269ad644f348fb
4
+ data.tar.gz: 17651f7849934be016f8957692fe0a29625d25e7
5
5
  SHA512:
6
- metadata.gz: 767c81f7b1bd795ae1636701de170f8bd1941e378a330e186493a3eeec165b23b45080f0b5ad64ea4168e132fdc62d9bee4e13aa09dd1b82090e92725e7b1b40
7
- data.tar.gz: 825867a7c3d2ed18658db76e4ae8b03957b64393dddfd726617d64c333b9a4d9d7199d161eeb1d819ee6a5ba2858ced561e953451634601c3fa61c6080974b3a
6
+ metadata.gz: 7bee9a23c0fae2cf78f79ae6d874a67c7d693aba2267a3783ebe75e3dc7a739dd65a741146d4d657e192f081e8cb61b768ebf6c2295f455ee172dd05baf3bd55
7
+ data.tar.gz: 1104aabae41cda5282cf92d678849d57611e947b9ba17bf59d7e5e6d7956bec7de8ee5115f3b845d3810f124c07ef86835dbc526988a4c87ead5e3bd9f13cac6
@@ -64,12 +64,23 @@ module ActiveGraphQL
64
64
  return if params.blank?
65
65
 
66
66
  param_strings = params.map do |k, v|
67
- "#{k.to_s.camelize(:lower)}: \"#{v}\""
67
+ "#{k.to_s.camelize(:lower)}: #{qargument(v)}"
68
68
  end
69
69
 
70
70
  param_strings.join(', ')
71
71
  end
72
72
 
73
+ def qargument(value)
74
+ case value
75
+ when Array
76
+ "[#{value.map{ |v| qargument(v) }.join(', ')}]"
77
+ when String
78
+ "\"#{value}\""
79
+ else
80
+ value.to_s
81
+ end
82
+ end
83
+
73
84
  def qgraph(graph)
74
85
  graph_strings = graph.map do |item|
75
86
  case item
@@ -1,3 +1,3 @@
1
1
  module ActiveGraphQL
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activegraphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wakoopa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-21 00:00:00.000000000 Z
11
+ date: 2017-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler