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 +4 -4
- data/lib/graphiti_gql/active_resource.rb +10 -7
- data/lib/graphiti_gql/schema/fields/show.rb +1 -1
- data/lib/graphiti_gql/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 521b1221d03c83804b5a14f114ca3d2f6c82f4786e25ffc405f61358a5706a50
|
4
|
+
data.tar.gz: ff6d11ba796b3ab11e201e25f4b82f5facfac722eeaacde6caef89dea32dfccd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 << %|
|
data/lib/graphiti_gql/version.rb
CHANGED