graphiti_gql 0.2.36 → 0.2.38

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
  SHA256:
3
- metadata.gz: 13d49008bd87abf491d57b808a580e37b3e5858ca9154819de0193b97c974324
4
- data.tar.gz: 6d31657f529586af79e08686521485b255685b4f5aac7ebee0f283f1fd244878
3
+ metadata.gz: 521b1221d03c83804b5a14f114ca3d2f6c82f4786e25ffc405f61358a5706a50
4
+ data.tar.gz: ff6d11ba796b3ab11e201e25f4b82f5facfac722eeaacde6caef89dea32dfccd
5
5
  SHA512:
6
- metadata.gz: b6ad8cf8e9e4385010b6b2b130d4da1e898a9184cf0590de248387eeaba96c4b469268997cbba2337d54f43c844f48b804cd9c7119659088535130795a53d873
7
- data.tar.gz: 6ba27d4b084235298244215140acac009a0a9081c6aea2bca9f2d6e83aa919ab8e8e96045642ab5c8bb542bc48015832edfb5991841988b4618c5b5a98ddfb55
6
+ metadata.gz: 562e34746322cb513da242b8d3e7f95a0108196092f5388e04564b26a21915b40bf2bdf7f7d08568d2dae34521279ed939e1a0b91676779467cf87fc1f5de610
7
+ data.tar.gz: 4a8d8e0da96d45081df94c00eefb25f924490ac7b0e8f88c11f319931aa1e6de1afe460a411bf92f14111c7c75960a85813e9551769e39f9132cb54826c73ee6
@@ -11,7 +11,7 @@ module GraphitiGql
11
11
  hash.each_pair do |key, value|
12
12
  if value.is_a?(Hash)
13
13
  if (sideload = resource.sideload(key))
14
- if value.key?(:edges)
14
+ if value.key?(:edges)
15
15
  @edges[key] = value[:edges].map do |edge|
16
16
  node_id = edge[:node][:id] if edge[:node]
17
17
  Node.new(edge.except(:node).merge(node_id: node_id))
@@ -109,7 +109,7 @@ module GraphitiGql
109
109
  def errors
110
110
  response[:errors]
111
111
  end
112
-
112
+
113
113
  def error_messages
114
114
  response[:errors].map { |e| e[:message] }
115
115
  end
@@ -117,11 +117,11 @@ module GraphitiGql
117
117
  def edges
118
118
  data[data.keys.first][:edges]
119
119
  end
120
-
120
+
121
121
  def stats
122
122
  underscore(data[data.keys.first][:stats])
123
123
  end
124
-
124
+
125
125
  def page_info
126
126
  underscore(data[data.keys.first][:pageInfo])
127
127
  end
@@ -173,6 +173,9 @@ module GraphitiGql
173
173
  # NB HASH (?)
174
174
  includes.each do |inc|
175
175
  sideload = @resource.sideload(inc.to_sym)
176
+ if sideload.nil?
177
+ raise "Passed option \"include: #{inc}\" but #{@resource} does not have an association with that name!"
178
+ end
176
179
  to_one = [:belongs_to, :has_one, :polymorphic_belongs_to].include?(sideload.type)
177
180
  indent = " " if !to_one
178
181
 
@@ -222,7 +225,7 @@ module GraphitiGql
222
225
  end
223
226
  end
224
227
  end
225
-
228
+
226
229
  q << %|
227
230
  }
228
231
  }|
@@ -246,12 +249,12 @@ module GraphitiGql
246
249
  q << %|
247
250
  #{calc.to_s.camelize(:lower)}|
248
251
  end
249
-
252
+
250
253
  q << %|
251
254
  }|
252
255
  end
253
256
  q << %|
254
- }|
257
+ }|
255
258
  end
256
259
 
257
260
  q << %|
@@ -17,7 +17,7 @@ module GraphitiGql
17
17
  _registered = @registered
18
18
  query.define_method name do |**arguments|
19
19
  params = Util.params_from_args(arguments)
20
- _registered[:resource].all(params).data[0]
20
+ _registered[:resource].find(params).data
21
21
  end
22
22
  end
23
23
 
@@ -1,3 +1,3 @@
1
1
  module GraphitiGql
2
- VERSION = "0.2.36"
2
+ VERSION = "0.2.38"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti_gql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.36
4
+ version: 0.2.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond