graphiti 1.6.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/graphiti/resource/interface.rb +4 -4
- data/lib/graphiti/resource_proxy.rb +3 -2
- data/lib/graphiti/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60dd55a9db78fcc197c66de85b88bd69e840462d77a679dbb76fcd41b040dbe1
|
4
|
+
data.tar.gz: e6a2cdefe4435864ea9101c94ac122d3c11ba0e85b7284f19a08f5ec4a3cee0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2264e0a1313762c00ffb96fbb80c60bbc7d6406e37fedc8eef0a9b813b6bc5d5ff9443ca165d2afcf7499c61f9746a0d851b699b9ec5f90ba5ca74c16932c428
|
7
|
+
data.tar.gz: 74d51069de9047b07d213c628889766d54d8e8c43812d75a433247e70bc2b027dc7735e310bd0460a36e37083c7a9306dddbeb5d15b0160987cb8f5a65daaa93
|
data/CHANGELOG.md
CHANGED
@@ -5,7 +5,7 @@ module Graphiti
|
|
5
5
|
|
6
6
|
class_methods do
|
7
7
|
def all(params = {}, base_scope = nil)
|
8
|
-
|
8
|
+
validate_request!(params)
|
9
9
|
_all(params, {}, base_scope)
|
10
10
|
end
|
11
11
|
|
@@ -17,7 +17,7 @@ module Graphiti
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def find(params = {}, base_scope = nil)
|
20
|
-
|
20
|
+
validate_request!(params)
|
21
21
|
_find(params, base_scope)
|
22
22
|
end
|
23
23
|
|
@@ -38,14 +38,14 @@ module Graphiti
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def build(params, base_scope = nil)
|
41
|
-
|
41
|
+
validate_request!(params)
|
42
42
|
runner = Runner.new(self, params)
|
43
43
|
runner.proxy(base_scope, single: true, raise_on_missing: true)
|
44
44
|
end
|
45
45
|
|
46
46
|
private
|
47
47
|
|
48
|
-
def
|
48
|
+
def validate_request!(params)
|
49
49
|
return if Graphiti.context[:graphql] || !validate_endpoints?
|
50
50
|
|
51
51
|
if context&.respond_to?(:request)
|
@@ -74,6 +74,7 @@ module Graphiti
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
alias_method :to_a, :data
|
77
|
+
alias_method :resolve_data, :data
|
77
78
|
|
78
79
|
def meta
|
79
80
|
@meta ||= data.respond_to?(:meta) ? data.meta : {}
|
@@ -136,7 +137,7 @@ module Graphiti
|
|
136
137
|
end
|
137
138
|
|
138
139
|
def destroy
|
139
|
-
|
140
|
+
resolve_data
|
140
141
|
transaction_response = @resource.transaction do
|
141
142
|
metadata = {method: :destroy}
|
142
143
|
model = @resource.destroy(@query.filters[:id], metadata)
|
@@ -154,7 +155,7 @@ module Graphiti
|
|
154
155
|
end
|
155
156
|
|
156
157
|
def update
|
157
|
-
|
158
|
+
resolve_data
|
158
159
|
save(action: :update)
|
159
160
|
end
|
160
161
|
|
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.6.
|
4
|
+
version: 1.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|