Skip to content

Commit 265e613

Browse files
committed
Test GraphQLError keyword arguments
Replicates graphql/graphql-js@ff06428
1 parent 74d5057 commit 265e613

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/error/test_graphql_error.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ def has_a_name_message_extensions_and_stack_trace():
4747
assert e.__traceback__ is None
4848
assert str(e) == "msg"
4949

50+
def can_pass_positional_and_keyword_arguments():
51+
e1 = GraphQLError(
52+
"msg",
53+
[field_node],
54+
source,
55+
[1, 2, 3],
56+
["a", "b", "c"],
57+
Exception("test"),
58+
{"foo": "bar"},
59+
)
60+
e2 = GraphQLError(
61+
message="msg",
62+
nodes=[field_node],
63+
source=source,
64+
positions=[1, 2, 3],
65+
path=["a", "b", "c"],
66+
original_error=Exception("test"),
67+
extensions={"foo": "bar"},
68+
)
69+
assert e1 == e2
70+
5071
def formatted_dict_has_only_keys_prescribed_in_the_spec():
5172
e = GraphQLError(
5273
"msg",

0 commit comments

Comments
 (0)