Skip to content

Commit 37bcc08

Browse files
committed
Make clientMutationId optional
1 parent d3ed165 commit 37bcc08

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/Mutation/Mutation.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static function mutationWithClientMutationId(array $config)
4949
$inputFieldsResolved = self::resolveMaybeThunk($inputFields);
5050
return array_merge($inputFieldsResolved !== null ? $inputFieldsResolved : [], [
5151
'clientMutationId' => [
52-
'type' => Type::nonNull(Type::string())
52+
'type' => Type::string()
5353
]
5454
]);
5555
};
@@ -58,7 +58,7 @@ public static function mutationWithClientMutationId(array $config)
5858
$outputFieldsResolved = self::resolveMaybeThunk($outputFields);
5959
return array_merge($outputFieldsResolved !== null ? $outputFieldsResolved : [], [
6060
'clientMutationId' => [
61-
'type' => Type::nonNull(Type::string())
61+
'type' => Type::string()
6262
]
6363
]);
6464
};

tests/Mutation/MutationTest.php

+6-12
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,9 @@ public function testIntrospection()
204204
[
205205
'name' => 'clientMutationId',
206206
'type' => [
207-
'name' => null,
208-
'kind' => 'NON_NULL',
209-
'ofType' => [
210-
'name' => 'String',
211-
'kind' => 'SCALAR'
212-
]
207+
'name' => 'String',
208+
'kind' => 'SCALAR',
209+
'ofType' => null
213210
]
214211
]
215212
]
@@ -254,12 +251,9 @@ public function testContainsCorrectPayload() {
254251
[
255252
'name' => 'clientMutationId',
256253
'type' => [
257-
'name' => null,
258-
'kind' => 'NON_NULL',
259-
'ofType' => [
260-
'name' => 'String',
261-
'kind' => 'SCALAR'
262-
]
254+
'name' => 'String',
255+
'kind' => 'SCALAR',
256+
'ofType' => null
263257
]
264258
]
265259
]

0 commit comments

Comments
 (0)