Skip to content

Commit 70babdd

Browse files
committed
Move error classes higher in the load order
Fixes a weird require/load-order issue that showed up while I was trying to validate default values. See the explanation at rmosolgo#3448 (comment)
1 parent 5ab3e5e commit 70babdd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/graphql.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,19 @@ def match?(pattern)
8181
# Order matters for these:
8282

8383
require "graphql/execution_error"
84+
require "graphql/runtime_type_error"
85+
require "graphql/unresolved_type_error"
86+
require "graphql/invalid_null_error"
87+
require "graphql/analysis_error"
88+
require "graphql/coercion_error"
89+
require "graphql/invalid_name_error"
90+
require "graphql/integer_decoding_error"
91+
require "graphql/integer_encoding_error"
92+
require "graphql/string_encoding_error"
93+
8494
require "graphql/define"
8595
require "graphql/base_type"
8696
require "graphql/object_type"
87-
8897
require "graphql/enum_type"
8998
require "graphql/input_object_type"
9099
require "graphql/interface_type"
@@ -109,9 +118,6 @@ def match?(pattern)
109118
require "graphql/tracing"
110119
require "graphql/dig"
111120
require "graphql/execution"
112-
require "graphql/runtime_type_error"
113-
require "graphql/unresolved_type_error"
114-
require "graphql/invalid_null_error"
115121
require "graphql/pagination"
116122
require "graphql/schema"
117123
require "graphql/query"
@@ -133,12 +139,6 @@ def match?(pattern)
133139
require "graphql/dataloader"
134140
require "graphql/introspection"
135141

136-
require "graphql/analysis_error"
137-
require "graphql/coercion_error"
138-
require "graphql/invalid_name_error"
139-
require "graphql/integer_decoding_error"
140-
require "graphql/integer_encoding_error"
141-
require "graphql/string_encoding_error"
142142
require "graphql/version"
143143
require "graphql/compatibility"
144144
require "graphql/function"

0 commit comments

Comments
 (0)