mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-23 07:00:56 +03:00
Make clientMutationId optional
This commit is contained in:
parent
4ccddf4b7b
commit
4d387cc1aa
|
@ -56,8 +56,7 @@ def test_mutation_arguments():
|
|||
client_mutation_id_field = inner_type._meta.fields_map[
|
||||
'clientMutationId']
|
||||
assert issubclass(inner_type, graphene.InputObjectType)
|
||||
assert isinstance(client_mutation_id_field.type, graphene.NonNull)
|
||||
assert isinstance(client_mutation_id_field.type.of_type, graphene.String)
|
||||
assert isinstance(client_mutation_id_field.type, graphene.String)
|
||||
assert client_mutation_id_field.object_type == inner_type
|
||||
assert isinstance(schema.T(client_mutation_id_field), GraphQLInputObjectField)
|
||||
|
||||
|
@ -65,7 +64,7 @@ def test_mutation_arguments():
|
|||
def test_execute_mutations():
|
||||
query = '''
|
||||
mutation M{
|
||||
first: changeNumber(input: {clientMutationId: "mutation1"}) {
|
||||
first: changeNumber(input: {}) {
|
||||
clientMutationId
|
||||
result
|
||||
},
|
||||
|
@ -81,7 +80,7 @@ def test_execute_mutations():
|
|||
'''
|
||||
expected = {
|
||||
'first': {
|
||||
'clientMutationId': 'mutation1',
|
||||
'clientMutationId': None,
|
||||
'result': '1',
|
||||
},
|
||||
'second': {
|
||||
|
|
|
@ -68,7 +68,7 @@ class Node(six.with_metaclass(NodeMeta, Interface)):
|
|||
|
||||
|
||||
class MutationInputType(InputObjectType):
|
||||
clientMutationId = String(required=True)
|
||||
clientMutationId = String()
|
||||
|
||||
|
||||
class RelayMutationMeta(MutationMeta):
|
||||
|
@ -90,7 +90,7 @@ class RelayMutationMeta(MutationMeta):
|
|||
|
||||
|
||||
class ClientIDMutation(six.with_metaclass(RelayMutationMeta, Mutation)):
|
||||
clientMutationId = String(required=True)
|
||||
clientMutationId = String()
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
|
Loading…
Reference in New Issue
Block a user