@@ -184,6 +184,16 @@ def serializes_to_include_message_and_locations():
184
184
"message" : "msg" ,
185
185
}
186
186
187
+ def serializes_to_include_path ():
188
+ path : List [Union [int , str ]] = ["path" , 3 , "to" , "field" ]
189
+ e = GraphQLError ("msg" , path = path )
190
+ assert e .path is path
191
+ assert repr (e ) == "GraphQLError('msg', path=['path', 3, 'to', 'field'])"
192
+ assert e .formatted == {
193
+ "message" : "msg" ,
194
+ "path" : ["path" , 3 , "to" , "field" ],
195
+ }
196
+
187
197
def serializes_to_include_all_standard_fields ():
188
198
e_short = GraphQLError ("msg" )
189
199
assert str (e_short ) == "msg"
@@ -210,16 +220,6 @@ def repr_includes_extensions():
210
220
e = GraphQLError ("msg" , extensions = {"foo" : "bar" })
211
221
assert repr (e ) == "GraphQLError('msg', extensions={'foo': 'bar'})"
212
222
213
- def serializes_to_include_path ():
214
- path : List [Union [int , str ]] = ["path" , 3 , "to" , "field" ]
215
- e = GraphQLError ("msg" , path = path )
216
- assert e .path is path
217
- assert repr (e ) == "GraphQLError('msg', path=['path', 3, 'to', 'field'])"
218
- assert e .formatted == {
219
- "message" : "msg" ,
220
- "path" : ["path" , 3 , "to" , "field" ],
221
- }
222
-
223
223
def always_stores_path_as_list ():
224
224
path : List [Union [int , str ]] = ["path" , 3 , "to" , "field" ]
225
225
e = GraphQLError ("msg," , path = tuple (path ))
0 commit comments