mutations-validate-outcome 0.8.1 → 0.8.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17fa9900ea6071170fb08b422168767a0742c7d7
|
4
|
+
data.tar.gz: c79145c76c2d5a919c1e76b2b6f1c69beca719ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afee3c02f19cf01fec6b346d834f1f83df57d65415d65b135f1afa410b54039386c4ef0933f34a3b3fe14589eadb9e0a48e8692371855959385d9c6756a7191a
|
7
|
+
data.tar.gz: 61ffc28639a24e450f70618aa78d9363c14dba21130552b54e922352d6956080c8b2eb7784f920daf204cd0eefe87011c6176e5e11a468a2e5ceee93046c23fa
|
@@ -49,7 +49,8 @@ module Mutations
|
|
49
49
|
return validation_outcome if has_errors?
|
50
50
|
validation_outcome(
|
51
51
|
execute.tap do |result|
|
52
|
-
|
52
|
+
case result
|
53
|
+
when Array
|
53
54
|
result.each_with_index.with_object({}) do |(e, i), memo|
|
54
55
|
_, outcome_error = self.class.outcome_filters.filter(e)
|
55
56
|
outcome_error = validate_outcome(e) if outcome_error.nil?
|
@@ -57,8 +58,8 @@ module Mutations
|
|
57
58
|
end.tap do |errs|
|
58
59
|
@outcome_errors = errs unless errs.empty?
|
59
60
|
end
|
60
|
-
|
61
|
-
|
61
|
+
when NilClass then nil
|
62
|
+
else add_outcome_error :self, :type, "This mutation must return Array instance (was #{result.class})"
|
62
63
|
end
|
63
64
|
end
|
64
65
|
)
|
@@ -68,11 +68,12 @@ module Mutations
|
|
68
68
|
return validation_outcome if has_errors?
|
69
69
|
validation_outcome(
|
70
70
|
execute.tap do |result|
|
71
|
-
|
71
|
+
case result
|
72
|
+
when Hash
|
72
73
|
_, @outcome_errors = self.class.outcome_filters.filter(result)
|
73
74
|
validate_outcome(result) unless has_outcome_errors?
|
74
|
-
|
75
|
-
|
75
|
+
when NilClass then nil
|
76
|
+
else add_outcome_error :self, :type, "This mutation must return Hash instance (was #{result.class})"
|
76
77
|
end
|
77
78
|
end
|
78
79
|
)
|
data/lib/mutations/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutations-validate-outcome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksei Matiushkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|