graphiti 1.3.6 → 1.3.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30f5b9382256603c1f3f8f4ab8c4e614804c1a2e2152617d7b19892bca6bd465
|
4
|
+
data.tar.gz: 948837bfa0f8deee2f44849aba9df2bb18f2fdf532a1caaab92b16c7d9ba91fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fe6fff9c219fd463378bbdc793f648cbeffe27c61c191f11e2aab4723e952d2d8f7cc26b334255e12adca3e9d819b1bbde17697a6621f11a28151d2649d6d9c
|
7
|
+
data.tar.gz: becca9eaa17f328a99669e1e855a4024862b45d1902ddf30de597f7b33e3f52e4145b0f1dba1542a0d144ba2bc1bdec280ad9d8fa599a102ead9efb5260e1ab3
|
@@ -192,7 +192,11 @@ module Graphiti
|
|
192
192
|
if options[:meta] && !options[:meta].empty?
|
193
193
|
if @graphql
|
194
194
|
if (stats = options[:meta][:stats])
|
195
|
-
|
195
|
+
camelized = {}
|
196
|
+
stats.each_pair do |key, value|
|
197
|
+
camelized[key.to_s.camelize(:lower).to_sym] = value
|
198
|
+
end
|
199
|
+
hash[top_level_key][:stats] = camelized
|
196
200
|
end
|
197
201
|
else
|
198
202
|
hash.merge!(options.slice(:meta))
|
@@ -68,7 +68,7 @@ module Graphiti
|
|
68
68
|
model_ref = model
|
69
69
|
has_many name, opts do
|
70
70
|
params do |hash|
|
71
|
-
hash[:filter][:"#{as}_type"] = model_ref.name
|
71
|
+
hash[:filter][:"#{as}_type"] = { eql: model_ref.name }
|
72
72
|
end
|
73
73
|
|
74
74
|
instance_eval(&blk) if blk
|
@@ -82,7 +82,7 @@ module Graphiti
|
|
82
82
|
model_ref = model
|
83
83
|
has_one name, opts do
|
84
84
|
params do |hash|
|
85
|
-
hash[:filter][:"#{as}_type"] = model_ref.name
|
85
|
+
hash[:filter][:"#{as}_type"] = { eql: model_ref.name }
|
86
86
|
end
|
87
87
|
|
88
88
|
instance_eval(&blk) if blk
|
@@ -85,9 +85,15 @@ module Graphiti
|
|
85
85
|
|
86
86
|
def stats
|
87
87
|
@stats ||= if @query.hash[:stats]
|
88
|
+
scope = @scope.unpaginated_object
|
89
|
+
if resource.adapter.can_group?
|
90
|
+
if (group = @query.hash[:stats].delete(:group_by))
|
91
|
+
scope = resource.adapter.group(scope, group[0])
|
92
|
+
end
|
93
|
+
end
|
88
94
|
payload = Stats::Payload.new @resource,
|
89
95
|
@query,
|
90
|
-
|
96
|
+
scope,
|
91
97
|
data
|
92
98
|
payload.generate
|
93
99
|
else
|
data/lib/graphiti/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|
@@ -355,7 +355,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
355
355
|
- !ruby/object:Gem::Version
|
356
356
|
version: '0'
|
357
357
|
requirements: []
|
358
|
-
rubygems_version: 3.
|
358
|
+
rubygems_version: 3.3.7
|
359
359
|
signing_key:
|
360
360
|
specification_version: 4
|
361
361
|
summary: Easily build jsonapi.org-compatible APIs
|