Skip to content

Commit 67e8fca

Browse files
committed
Remove non-null restriction on clientMutationId field definitions
Replicates graphql/graphql-relay-js@f2aee93 see graphql/graphql-relay-js#79
1 parent 2005711 commit 67e8fca

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Diff for: src/graphql_relay/mutation/mutation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ def mutation_with_client_mutation_id(
6262
def augmented_input_fields() -> GraphQLInputFieldMap:
6363
return dict(
6464
resolve_maybe_thunk(input_fields),
65-
clientMutationId=GraphQLInputField(GraphQLNonNull(GraphQLString)),
65+
clientMutationId=GraphQLInputField(GraphQLString),
6666
)
6767

6868
def augmented_output_fields() -> GraphQLFieldMap:
6969
return dict(
7070
resolve_maybe_thunk(output_fields),
71-
clientMutationId=GraphQLField(GraphQLNonNull(GraphQLString)),
71+
clientMutationId=GraphQLField(GraphQLString),
7272
)
7373

7474
output_type = GraphQLObjectType(name + "Payload", fields=augmented_output_fields)

Diff for: tests/star_wars_schema.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@
7878
# }
7979
#
8080
# input IntroduceShipInput {
81-
# clientMutationId: string!
81+
# clientMutationId: string
8282
# shipName: string!
8383
# factionId: ID!
8484
# }
8585
#
86-
# input IntroduceShipPayload {
87-
# clientMutationId: string!
86+
# type IntroduceShipPayload {
87+
# clientMutationId: string
8888
# ship: Ship
8989
# faction: Faction
9090
# }
@@ -201,13 +201,13 @@ def get_node_type(obj, _info, _type):
201201
#
202202
# It creates these two types implicitly:
203203
# input IntroduceShipInput {
204-
# clientMutationId: string!
204+
# clientMutationId: string
205205
# shipName: string!
206206
# factionId: ID!
207207
# }
208208
#
209-
# input IntroduceShipPayload {
210-
# clientMutationId: string!
209+
# type IntroduceShipPayload {
210+
# clientMutationId: string
211211
# ship: Ship
212212
# faction: Faction
213213
# }

0 commit comments

Comments
 (0)