@@ -27,21 +27,22 @@ Feature: GraphQL mutation support
27
27
And the response should be in JSON
28
28
And the header "Content-Type" should be equal to "application/json"
29
29
And the JSON node "data.__type.fields[0].name" should contain "delete"
30
- And the JSON node "data.__type.fields[0].description" should contain " Deletes "
31
- And the JSON node "data.__type.fields[0].type.name" should contain "DeleteMutation "
30
+ And the JSON node "data.__type.fields[0].description" should match '/^ Deletes a [A-z]+ \. $/'
31
+ And the JSON node "data.__type.fields[0].type.name" should match "/^delete[A-z]+Payload$/ "
32
32
And the JSON node "data.__type.fields[0].type.kind" should be equal to "OBJECT"
33
33
And the JSON node "data.__type.fields[0].args[0].name" should be equal to "input"
34
- And the JSON node "data.__type.fields[0].args[0].type.name" should contain "InputDeleteMutation "
34
+ And the JSON node "data.__type.fields[0].args[0].type.name" should match "/^delete[A-z]+Input$/ "
35
35
And the JSON node "data.__type.fields[0].args[0].type.kind" should be equal to "INPUT_OBJECT"
36
36
37
37
Scenario : Create an item
38
38
When I send the following GraphQL request:
39
39
"""
40
40
mutation {
41
- createFoo(input: {name: "A new one", bar: "new"}) {
42
- id,
43
- name,
41
+ createFoo(input: {name: "A new one", bar: "new", clientMutationId: "myId" }) {
42
+ id
43
+ name
44
44
bar
45
+ clientMutationId
45
46
}
46
47
}
47
48
"""
@@ -51,21 +52,24 @@ Feature: GraphQL mutation support
51
52
And the JSON node "data.createFoo.id" should be equal to "/foos/1"
52
53
And the JSON node "data.createFoo.name" should be equal to "A new one"
53
54
And the JSON node "data.createFoo.bar" should be equal to "new"
55
+ And the JSON node "data.createFoo.clientMutationId" should be equal to "myId"
54
56
55
57
@dropSchema
56
58
Scenario : Delete an item through a mutation
57
59
When I send the following GraphQL request:
58
60
"""
59
61
mutation {
60
- deleteFoo(input: {id: "/foos/1"}) {
62
+ deleteFoo(input: {id: "/foos/1", clientMutationId: "anotherId" }) {
61
63
id
64
+ clientMutationId
62
65
}
63
66
}
64
67
"""
65
68
Then the response status code should be 200
66
69
And the response should be in JSON
67
70
And the header "Content-Type" should be equal to "application/json"
68
71
And the JSON node "data.deleteFoo.id" should be equal to "/foos/1"
72
+ And the JSON node "data.deleteFoo.clientMutationId" should be equal to "anotherId"
69
73
70
74
@createSchema
71
75
@dropSchema
@@ -74,15 +78,17 @@ Feature: GraphQL mutation support
74
78
When I send the following GraphQL request:
75
79
"""
76
80
mutation {
77
- deleteCompositeRelation(input: {id: "/composite_relations/compositeItem=1;compositeLabel=1"}) {
81
+ deleteCompositeRelation(input: {id: "/composite_relations/compositeItem=1;compositeLabel=1", clientMutationId: "myId" }) {
78
82
id
83
+ clientMutationId
79
84
}
80
85
}
81
86
"""
82
87
Then the response status code should be 200
83
88
And the response should be in JSON
84
89
And the header "Content-Type" should be equal to "application/json"
85
90
And the JSON node "data.deleteCompositeRelation.id" should be equal to "/composite_relations/compositeItem=1;compositeLabel=1"
91
+ And the JSON node "data.deleteCompositeRelation.clientMutationId" should be equal to "myId"
86
92
87
93
@createSchema
88
94
@dropSchema
@@ -91,10 +97,11 @@ Feature: GraphQL mutation support
91
97
When I send the following GraphQL request:
92
98
"""
93
99
mutation {
94
- updateFoo(input: {id: "/foos/1", bar: "Modified description."}) {
95
- id,
96
- name,
100
+ updateFoo(input: {id: "/foos/1", bar: "Modified description.", clientMutationId: "myId" }) {
101
+ id
102
+ name
97
103
bar
104
+ clientMutationId
98
105
}
99
106
}
100
107
"""
@@ -104,6 +111,7 @@ Feature: GraphQL mutation support
104
111
And the JSON node "data.updateFoo.id" should be equal to "/foos/1"
105
112
And the JSON node "data.updateFoo.name" should be equal to "Hawsepipe"
106
113
And the JSON node "data.updateFoo.bar" should be equal to "Modified description."
114
+ And the JSON node "data.updateFoo.clientMutationId" should be equal to "myId"
107
115
108
116
@createSchema
109
117
@dropSchema
@@ -112,9 +120,10 @@ Feature: GraphQL mutation support
112
120
When I send the following GraphQL request:
113
121
"""
114
122
mutation {
115
- updateCompositeRelation(input: {id: "/composite_relations/compositeItem=1;compositeLabel=2", value: "Modified value."}) {
123
+ updateCompositeRelation(input: {id: "/composite_relations/compositeItem=1;compositeLabel=2", value: "Modified value.", clientMutationId: "myId" }) {
116
124
id
117
125
value
126
+ clientMutationId
118
127
}
119
128
}
120
129
"""
@@ -123,3 +132,4 @@ Feature: GraphQL mutation support
123
132
And the header "Content-Type" should be equal to "application/json"
124
133
And the JSON node "data.updateCompositeRelation.id" should be equal to "/composite_relations/compositeItem=1;compositeLabel=2"
125
134
And the JSON node "data.updateCompositeRelation.value" should be equal to "Modified value."
135
+ And the JSON node "data.updateCompositeRelation.clientMutationId" should be equal to "myId"
0 commit comments