@@ -71,14 +71,17 @@ class MyMutation(ClientIDMutation):
71
71
72
72
def test_mutation ():
73
73
fields = SaySomething ._meta .fields
74
- assert list (fields .keys ()) == ['phrase' ]
74
+ assert list (fields .keys ()) == ['phrase' , 'client_mutation_id' ]
75
75
assert isinstance (fields ['phrase' ], Field )
76
76
field = SaySomething .Field ()
77
77
assert field .type == SaySomething
78
78
assert list (field .args .keys ()) == ['input' ]
79
79
assert isinstance (field .args ['input' ], Argument )
80
80
assert isinstance (field .args ['input' ].type , NonNull )
81
81
assert field .args ['input' ].type .of_type == SaySomething .Input
82
+ assert isinstance (fields ['client_mutation_id' ], Field )
83
+ assert fields ['client_mutation_id' ].name == 'clientMutationId'
84
+ assert fields ['client_mutation_id' ].type == String
82
85
83
86
84
87
def test_mutation_input ():
@@ -94,7 +97,7 @@ def test_mutation_input():
94
97
95
98
def test_subclassed_mutation ():
96
99
fields = OtherMutation ._meta .fields
97
- assert list (fields .keys ()) == ['name' , 'my_node_edge' ]
100
+ assert list (fields .keys ()) == ['name' , 'my_node_edge' , 'client_mutation_id' ]
98
101
assert isinstance (fields ['name' ], Field )
99
102
field = OtherMutation .Field ()
100
103
assert field .type == OtherMutation
@@ -126,7 +129,7 @@ def test_subclassed_mutation_input():
126
129
127
130
def test_edge_query ():
128
131
executed = schema .execute (
129
- 'mutation a { other(input: {clientMutationId:"1"}) { myNodeEdge { cursor node { name }} } }'
132
+ 'mutation a { other(input: {clientMutationId:"1"}) { clientMutationId, myNodeEdge { cursor node { name }} } }'
130
133
)
131
134
assert not executed .errors
132
- assert dict (executed .data ) == {'other' : {'myNodeEdge' : {'cursor' : '1' , 'node' : {'name' : 'name' }}}}
135
+ assert dict (executed .data ) == {'other' : {'clientMutationId' : '1' , ' myNodeEdge' : {'cursor' : '1' , 'node' : {'name' : 'name' }}}}
0 commit comments