graphql_rails 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.hound.yml +1 -0
- data/.rubocop.yml +3 -3
- data/.ruby-version +1 -1
- data/.travis.yml +2 -2
- data/CHANGELOG.md +3 -0
- data/Gemfile +3 -2
- data/Gemfile.lock +141 -117
- data/docs/README.md +2 -2
- data/docs/components/controller.md +21 -5
- data/docs/components/model.md +43 -3
- data/docs/index.html +1 -1
- data/graphql_rails.gemspec +5 -5
- data/lib/generators/graphql_rails/templates/graphql_router_spec.erb +10 -7
- data/lib/graphql_rails/attributes/attributable.rb +2 -4
- data/lib/graphql_rails/attributes/attribute.rb +26 -6
- data/lib/graphql_rails/attributes/attribute_name_parser.rb +1 -1
- data/lib/graphql_rails/attributes/input_attribute.rb +5 -1
- data/lib/graphql_rails/concerns/service.rb +6 -2
- data/lib/graphql_rails/controller.rb +6 -6
- data/lib/graphql_rails/controller/action.rb +5 -1
- data/lib/graphql_rails/controller/build_controller_action_resolver.rb +2 -2
- data/lib/graphql_rails/controller/request.rb +1 -1
- data/lib/graphql_rails/controller/request/format_errors.rb +1 -1
- data/lib/graphql_rails/model/add_fields_to_graphql_type.rb +45 -0
- data/lib/graphql_rails/model/build_graphql_input_type.rb +1 -1
- data/lib/graphql_rails/model/call_graphql_model_method.rb +14 -1
- data/lib/graphql_rails/model/configurable.rb +6 -2
- data/lib/graphql_rails/model/configuration.rb +9 -4
- data/lib/graphql_rails/model/find_or_build_graphql_type.rb +64 -0
- data/lib/graphql_rails/model/find_or_build_graphql_type_class.rb +46 -0
- data/lib/graphql_rails/router.rb +2 -2
- data/lib/graphql_rails/router/resource_routes_builder.rb +8 -8
- data/lib/graphql_rails/router/route.rb +3 -7
- data/lib/graphql_rails/router/schema_builder.rb +1 -1
- data/lib/graphql_rails/rspec_controller_helpers.rb +2 -2
- data/lib/graphql_rails/version.rb +1 -1
- metadata +21 -14
- data/lib/graphql_rails/model/build_graphql_type.rb +0 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60ad653d6c6acbfe0816f0b7ddb406dae7131b1c07f86f7ab35b98813079edb1
|
4
|
+
data.tar.gz: ff9446c8240615d5cba3e6ac3206444d47d257d201278e0860d765976c8f99fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59caf8be61dcf8777a5cdc2ac498f389006e8630b9ef62076976a0be849e8e09466e8a7b76891bf6a5b42510f5efc0856666383e9bd6e3e68c245500fb308d47
|
7
|
+
data.tar.gz: 9851cb4dd601fa253c5790f39cbdf835403e08814c85db9f0646bd986ccb62650249216b2225f20dfa8ada581e0bd374e3eb30001dc51f2eb7a182d9c2f626c6
|
data/.hound.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -3,7 +3,7 @@ require: rubocop-rspec
|
|
3
3
|
RSpec/NestedGroups:
|
4
4
|
Enabled: false
|
5
5
|
|
6
|
-
|
6
|
+
Layout/LineLength:
|
7
7
|
Enabled: true
|
8
8
|
Max: 120
|
9
9
|
|
@@ -21,7 +21,7 @@ Lint/AmbiguousBlockAssociation:
|
|
21
21
|
Exclude:
|
22
22
|
- spec/**/*.rb
|
23
23
|
|
24
|
-
Naming/
|
24
|
+
Naming/MethodParameterName:
|
25
25
|
AllowedNames:
|
26
26
|
- 'to'
|
27
27
|
- 'at'
|
@@ -35,7 +35,7 @@ Style/ClassAndModuleChildren:
|
|
35
35
|
- spec/**/*_spec.rb
|
36
36
|
|
37
37
|
AllCops:
|
38
|
-
TargetRubyVersion: 2.
|
38
|
+
TargetRubyVersion: 2.7
|
39
39
|
Exclude:
|
40
40
|
- bin/*
|
41
41
|
- graphql_rails.gemspec
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
9
9
|
|
10
10
|
* Added/Changed/Deprecated/Removed/Fixed/Security: YOUR CHANGE HERE
|
11
11
|
|
12
|
+
* Added: `options` argument to model level attribute. Allows disabling automatic camelCase
|
13
|
+
* Fixed: methods with complex input arguments receives `Hash` instances instead of `GraphQL::Schema::InputObject`
|
14
|
+
|
12
15
|
## [1.0.0](2020-02-07)
|
13
16
|
|
14
17
|
* Added: "required" and "optional" flags for attribute
|
data/Gemfile
CHANGED
@@ -5,8 +5,9 @@ source 'https://rubygems.org'
|
|
5
5
|
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
6
6
|
|
7
7
|
group :development do
|
8
|
-
gem 'rubocop'
|
9
|
-
gem 'rubocop-
|
8
|
+
gem 'rubocop', '0.91.0'
|
9
|
+
gem 'rubocop-performance', '~> 1.8', '>= 1.8.1'
|
10
|
+
gem 'rubocop-rspec', '~> 1.44', '>= 1.44.1'
|
10
11
|
end
|
11
12
|
|
12
13
|
group :test do
|
data/Gemfile.lock
CHANGED
@@ -1,194 +1,218 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
graphql_rails (1.
|
4
|
+
graphql_rails (1.1.0)
|
5
5
|
activesupport (>= 4)
|
6
|
-
graphql (>= 1.
|
6
|
+
graphql (~> 1.11, >= 1.11.6)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (
|
12
|
-
actionpack (=
|
11
|
+
actioncable (6.0.3.4)
|
12
|
+
actionpack (= 6.0.3.4)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (>= 0.6.1)
|
15
|
-
|
16
|
-
actionpack (=
|
17
|
-
|
18
|
-
|
15
|
+
actionmailbox (6.0.3.4)
|
16
|
+
actionpack (= 6.0.3.4)
|
17
|
+
activejob (= 6.0.3.4)
|
18
|
+
activerecord (= 6.0.3.4)
|
19
|
+
activestorage (= 6.0.3.4)
|
20
|
+
activesupport (= 6.0.3.4)
|
21
|
+
mail (>= 2.7.1)
|
22
|
+
actionmailer (6.0.3.4)
|
23
|
+
actionpack (= 6.0.3.4)
|
24
|
+
actionview (= 6.0.3.4)
|
25
|
+
activejob (= 6.0.3.4)
|
19
26
|
mail (~> 2.5, >= 2.5.4)
|
20
27
|
rails-dom-testing (~> 2.0)
|
21
|
-
actionpack (
|
22
|
-
actionview (=
|
23
|
-
activesupport (=
|
24
|
-
rack (~> 2.0)
|
28
|
+
actionpack (6.0.3.4)
|
29
|
+
actionview (= 6.0.3.4)
|
30
|
+
activesupport (= 6.0.3.4)
|
31
|
+
rack (~> 2.0, >= 2.0.8)
|
25
32
|
rack-test (>= 0.6.3)
|
26
33
|
rails-dom-testing (~> 2.0)
|
27
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
28
|
-
|
29
|
-
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
+
actiontext (6.0.3.4)
|
36
|
+
actionpack (= 6.0.3.4)
|
37
|
+
activerecord (= 6.0.3.4)
|
38
|
+
activestorage (= 6.0.3.4)
|
39
|
+
activesupport (= 6.0.3.4)
|
40
|
+
nokogiri (>= 1.8.5)
|
41
|
+
actionview (6.0.3.4)
|
42
|
+
activesupport (= 6.0.3.4)
|
30
43
|
builder (~> 3.1)
|
31
44
|
erubi (~> 1.4)
|
32
45
|
rails-dom-testing (~> 2.0)
|
33
|
-
rails-html-sanitizer (~> 1.
|
34
|
-
activejob (
|
35
|
-
activesupport (=
|
46
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
47
|
+
activejob (6.0.3.4)
|
48
|
+
activesupport (= 6.0.3.4)
|
36
49
|
globalid (>= 0.3.6)
|
37
|
-
activemodel (
|
38
|
-
activesupport (=
|
39
|
-
activerecord (
|
40
|
-
activemodel (=
|
41
|
-
activesupport (=
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
activerecord (=
|
50
|
+
activemodel (6.0.3.4)
|
51
|
+
activesupport (= 6.0.3.4)
|
52
|
+
activerecord (6.0.3.4)
|
53
|
+
activemodel (= 6.0.3.4)
|
54
|
+
activesupport (= 6.0.3.4)
|
55
|
+
activestorage (6.0.3.4)
|
56
|
+
actionpack (= 6.0.3.4)
|
57
|
+
activejob (= 6.0.3.4)
|
58
|
+
activerecord (= 6.0.3.4)
|
46
59
|
marcel (~> 0.3.1)
|
47
|
-
activesupport (
|
60
|
+
activesupport (6.0.3.4)
|
48
61
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
49
62
|
i18n (>= 0.7, < 2)
|
50
63
|
minitest (~> 5.1)
|
51
64
|
tzinfo (~> 1.1)
|
52
|
-
|
53
|
-
ast (2.4.
|
54
|
-
bson (4.
|
55
|
-
builder (3.2.
|
56
|
-
byebug (11.
|
57
|
-
codecov (0.
|
65
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
66
|
+
ast (2.4.1)
|
67
|
+
bson (4.11.0)
|
68
|
+
builder (3.2.4)
|
69
|
+
byebug (11.1.3)
|
70
|
+
codecov (0.2.12)
|
58
71
|
json
|
59
72
|
simplecov
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
diff-lcs (1.3)
|
73
|
+
coderay (1.1.3)
|
74
|
+
concurrent-ruby (1.1.7)
|
75
|
+
crass (1.0.6)
|
76
|
+
diff-lcs (1.4.4)
|
65
77
|
docile (1.3.2)
|
66
|
-
erubi (1.
|
78
|
+
erubi (1.9.0)
|
67
79
|
globalid (0.4.2)
|
68
80
|
activesupport (>= 4.2.0)
|
69
|
-
graphql (1.
|
70
|
-
i18n (1.
|
81
|
+
graphql (1.11.6)
|
82
|
+
i18n (1.8.5)
|
71
83
|
concurrent-ruby (~> 1.0)
|
72
|
-
|
73
|
-
|
74
|
-
loofah (2.3.1)
|
84
|
+
json (2.3.1)
|
85
|
+
loofah (2.7.0)
|
75
86
|
crass (~> 1.0.2)
|
76
87
|
nokogiri (>= 1.5.9)
|
77
88
|
mail (2.7.1)
|
78
89
|
mini_mime (>= 0.1.1)
|
79
90
|
marcel (0.3.3)
|
80
91
|
mimemagic (~> 0.3.2)
|
81
|
-
method_source (0.
|
82
|
-
mimemagic (0.3.
|
83
|
-
mini_mime (1.0.
|
92
|
+
method_source (1.0.0)
|
93
|
+
mimemagic (0.3.5)
|
94
|
+
mini_mime (1.0.2)
|
84
95
|
mini_portile2 (2.4.0)
|
85
|
-
minitest (5.
|
86
|
-
mongo (2.
|
87
|
-
bson (>= 4.
|
88
|
-
mongoid (7.
|
89
|
-
activemodel (>= 5.1, < 6.
|
90
|
-
mongo (>= 2.
|
91
|
-
nio4r (2.
|
92
|
-
nokogiri (1.10.
|
96
|
+
minitest (5.14.2)
|
97
|
+
mongo (2.13.1)
|
98
|
+
bson (>= 4.8.2, < 5.0.0)
|
99
|
+
mongoid (7.1.4)
|
100
|
+
activemodel (>= 5.1, < 6.1)
|
101
|
+
mongo (>= 2.7.0, < 3.0.0)
|
102
|
+
nio4r (2.5.4)
|
103
|
+
nokogiri (1.10.10)
|
93
104
|
mini_portile2 (~> 2.4.0)
|
94
|
-
parallel (1.19.
|
95
|
-
parser (2.7.0
|
96
|
-
ast (~> 2.4.
|
97
|
-
pry (0.
|
98
|
-
coderay (~> 1.1
|
99
|
-
method_source (~>
|
100
|
-
pry-byebug (3.
|
105
|
+
parallel (1.19.2)
|
106
|
+
parser (2.7.2.0)
|
107
|
+
ast (~> 2.4.1)
|
108
|
+
pry (0.13.1)
|
109
|
+
coderay (~> 1.1)
|
110
|
+
method_source (~> 1.0)
|
111
|
+
pry-byebug (3.9.0)
|
101
112
|
byebug (~> 11.0)
|
102
|
-
pry (~> 0.
|
103
|
-
rack (2.
|
113
|
+
pry (~> 0.13.0)
|
114
|
+
rack (2.2.3)
|
104
115
|
rack-test (1.1.0)
|
105
116
|
rack (>= 1.0, < 3)
|
106
|
-
rails (
|
107
|
-
actioncable (=
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
117
|
+
rails (6.0.3.4)
|
118
|
+
actioncable (= 6.0.3.4)
|
119
|
+
actionmailbox (= 6.0.3.4)
|
120
|
+
actionmailer (= 6.0.3.4)
|
121
|
+
actionpack (= 6.0.3.4)
|
122
|
+
actiontext (= 6.0.3.4)
|
123
|
+
actionview (= 6.0.3.4)
|
124
|
+
activejob (= 6.0.3.4)
|
125
|
+
activemodel (= 6.0.3.4)
|
126
|
+
activerecord (= 6.0.3.4)
|
127
|
+
activestorage (= 6.0.3.4)
|
128
|
+
activesupport (= 6.0.3.4)
|
116
129
|
bundler (>= 1.3.0)
|
117
|
-
railties (=
|
130
|
+
railties (= 6.0.3.4)
|
118
131
|
sprockets-rails (>= 2.0.0)
|
119
132
|
rails-dom-testing (2.0.3)
|
120
133
|
activesupport (>= 4.2.0)
|
121
134
|
nokogiri (>= 1.6)
|
122
|
-
rails-html-sanitizer (1.0
|
123
|
-
loofah (~> 2.
|
124
|
-
railties (
|
125
|
-
actionpack (=
|
126
|
-
activesupport (=
|
135
|
+
rails-html-sanitizer (1.3.0)
|
136
|
+
loofah (~> 2.3)
|
137
|
+
railties (6.0.3.4)
|
138
|
+
actionpack (= 6.0.3.4)
|
139
|
+
activesupport (= 6.0.3.4)
|
127
140
|
method_source
|
128
141
|
rake (>= 0.8.7)
|
129
|
-
thor (>= 0.
|
142
|
+
thor (>= 0.20.3, < 2.0)
|
130
143
|
rainbow (3.0.0)
|
131
|
-
rake (
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
rspec-
|
136
|
-
|
137
|
-
rspec-
|
138
|
-
rspec-
|
144
|
+
rake (13.0.1)
|
145
|
+
regexp_parser (1.8.2)
|
146
|
+
rexml (3.2.4)
|
147
|
+
rspec (3.10.0)
|
148
|
+
rspec-core (~> 3.10.0)
|
149
|
+
rspec-expectations (~> 3.10.0)
|
150
|
+
rspec-mocks (~> 3.10.0)
|
151
|
+
rspec-core (3.10.0)
|
152
|
+
rspec-support (~> 3.10.0)
|
153
|
+
rspec-expectations (3.10.0)
|
139
154
|
diff-lcs (>= 1.2.0, < 2.0)
|
140
|
-
rspec-support (~> 3.
|
141
|
-
rspec-mocks (3.
|
155
|
+
rspec-support (~> 3.10.0)
|
156
|
+
rspec-mocks (3.10.0)
|
142
157
|
diff-lcs (>= 1.2.0, < 2.0)
|
143
|
-
rspec-support (~> 3.
|
144
|
-
rspec-support (3.
|
145
|
-
rubocop (0.
|
146
|
-
jaro_winkler (~> 1.5.1)
|
158
|
+
rspec-support (~> 3.10.0)
|
159
|
+
rspec-support (3.10.0)
|
160
|
+
rubocop (0.91.0)
|
147
161
|
parallel (~> 1.10)
|
148
|
-
parser (>= 2.7.
|
162
|
+
parser (>= 2.7.1.1)
|
149
163
|
rainbow (>= 2.2.2, < 4.0)
|
164
|
+
regexp_parser (>= 1.7)
|
165
|
+
rexml
|
166
|
+
rubocop-ast (>= 0.4.0, < 1.0)
|
150
167
|
ruby-progressbar (~> 1.7)
|
151
|
-
unicode-display_width (>= 1.4.0, <
|
152
|
-
rubocop-
|
153
|
-
|
168
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
169
|
+
rubocop-ast (0.8.0)
|
170
|
+
parser (>= 2.7.1.5)
|
171
|
+
rubocop-performance (1.8.1)
|
172
|
+
rubocop (>= 0.87.0)
|
173
|
+
rubocop-ast (>= 0.4.0)
|
174
|
+
rubocop-rspec (1.44.1)
|
175
|
+
rubocop (~> 0.87)
|
176
|
+
rubocop-ast (>= 0.7.1)
|
154
177
|
ruby-progressbar (1.10.1)
|
155
|
-
simplecov (0.
|
178
|
+
simplecov (0.19.1)
|
156
179
|
docile (~> 1.1)
|
157
|
-
simplecov-html (~> 0.11
|
158
|
-
simplecov-html (0.
|
159
|
-
sprockets (
|
180
|
+
simplecov-html (~> 0.11)
|
181
|
+
simplecov-html (0.12.3)
|
182
|
+
sprockets (4.0.2)
|
160
183
|
concurrent-ruby (~> 1.0)
|
161
184
|
rack (> 1, < 3)
|
162
|
-
sprockets-rails (3.2.
|
185
|
+
sprockets-rails (3.2.2)
|
163
186
|
actionpack (>= 4.0)
|
164
187
|
activesupport (>= 4.0)
|
165
188
|
sprockets (>= 3.0.0)
|
166
|
-
thor (0.
|
189
|
+
thor (1.0.1)
|
167
190
|
thread_safe (0.3.6)
|
168
|
-
tzinfo (1.2.
|
191
|
+
tzinfo (1.2.7)
|
169
192
|
thread_safe (~> 0.1)
|
170
|
-
unicode-display_width (1.
|
171
|
-
|
172
|
-
websocket-driver (0.7.1)
|
193
|
+
unicode-display_width (1.7.0)
|
194
|
+
websocket-driver (0.7.3)
|
173
195
|
websocket-extensions (>= 0.1.0)
|
174
|
-
websocket-extensions (0.1.
|
196
|
+
websocket-extensions (0.1.5)
|
197
|
+
zeitwerk (2.4.1)
|
175
198
|
|
176
199
|
PLATFORMS
|
177
200
|
ruby
|
178
201
|
|
179
202
|
DEPENDENCIES
|
180
203
|
activerecord
|
181
|
-
bundler (~>
|
204
|
+
bundler (~> 2)
|
182
205
|
codecov
|
183
206
|
graphql_rails!
|
184
207
|
mongoid
|
185
208
|
pry-byebug
|
186
|
-
rails (~>
|
187
|
-
rake (~>
|
209
|
+
rails (~> 6)
|
210
|
+
rake (~> 13.0)
|
188
211
|
rspec (~> 3.0)
|
189
|
-
rubocop
|
190
|
-
rubocop-
|
212
|
+
rubocop (= 0.91.0)
|
213
|
+
rubocop-performance (~> 1.8, >= 1.8.1)
|
214
|
+
rubocop-rspec (~> 1.44, >= 1.44.1)
|
191
215
|
simplecov
|
192
216
|
|
193
217
|
BUNDLED WITH
|
194
|
-
1.
|
218
|
+
2.1.4
|
data/docs/README.md
CHANGED
@@ -109,10 +109,10 @@ GraphqlRails::Router.draw do
|
|
109
109
|
|
110
110
|
# you can use namespaced controllers too:
|
111
111
|
scope module: 'admin' do
|
112
|
-
# `updateTranslations` route will be
|
112
|
+
# `updateTranslations` route will be handled by `Admin::TranslationsController`
|
113
113
|
mutation :updateTranslations, to: 'translations#update'
|
114
114
|
|
115
|
-
# all :groups routes will be
|
115
|
+
# all :groups routes will be handled by `Admin::GroupsController`
|
116
116
|
resources :groups
|
117
117
|
end
|
118
118
|
end
|
@@ -169,7 +169,7 @@ class UsersController < GraphqlRails::Controller
|
|
169
169
|
end
|
170
170
|
```
|
171
171
|
|
172
|
-
Also check ['decorating controller responses'](
|
172
|
+
Also check ['decorating controller responses'](components/decorator) for more details about working with active record and decorators.
|
173
173
|
|
174
174
|
#### *max_page_size*
|
175
175
|
|
@@ -219,6 +219,22 @@ class UsersController < GraphqlRails::Controller
|
|
219
219
|
end
|
220
220
|
```
|
221
221
|
|
222
|
+
You can also return raw graphql-ruby types:
|
223
|
+
|
224
|
+
```ruby
|
225
|
+
# raw graphql-ruby type:
|
226
|
+
class OrderType < GraphQL::Schema::Object
|
227
|
+
graphql_name 'Order'
|
228
|
+
field :id, ID
|
229
|
+
end
|
230
|
+
|
231
|
+
class UsersController < GraphqlRails::Controller
|
232
|
+
action(:last_order).permit(:id).returns(OrderType)
|
233
|
+
end
|
234
|
+
```
|
235
|
+
|
236
|
+
Check [graphql-ruby documentation](https://graphql-ruby.org) for more details about graphql-ruby types.
|
237
|
+
|
222
238
|
### *returns_list*
|
223
239
|
|
224
240
|
When you have defined `model` dynamically, you can use `returns_list` to indicate that action must return list without specifying model type for each action. By default list and inner types are required but you can change that with `required_list: false` and `required_inner: false`
|
@@ -438,13 +454,13 @@ end
|
|
438
454
|
|
439
455
|
## decorating objects
|
440
456
|
|
441
|
-
See ['Decorating controller responses'](
|
457
|
+
See ['Decorating controller responses'](components/decorator) for various options how you can decorate paginated responses
|
442
458
|
|
443
459
|
## Rendering errors
|
444
460
|
|
445
461
|
### Rendering strings as errors
|
446
462
|
|
447
|
-
The
|
463
|
+
The simplest way to render an error is to provide a list of error messages, like this:
|
448
464
|
|
449
465
|
```ruby
|
450
466
|
class UsersController < GraphqlRails::Controller
|
@@ -509,12 +525,12 @@ end
|
|
509
525
|
|
510
526
|
### Raising custom error classes
|
511
527
|
|
512
|
-
If you want to have customized error classes you need to create errors which
|
528
|
+
If you want to have customized error classes you need to create errors which inherit from `GraphqlRails::ExecutionError`
|
513
529
|
|
514
530
|
```ruby
|
515
531
|
class MyCustomError < GraphqlRails::ExecutionError
|
516
532
|
def to_h
|
517
|
-
# this part will be rendered in
|
533
|
+
# this part will be rendered in graphql
|
518
534
|
{ something_custom: 'yes' }
|
519
535
|
end
|
520
536
|
end
|