Skip to content

When passing null as input in mutation, value does not show up in args #103

Closed
@BossGrand

Description

@BossGrand

For example the following will raise an exception when number is null

 class EditNumber(graphene.ClientIDMutation):
    class Input:
        number = graphene.Int()
    
     success = graphene.Boolean()

     @classmethod
     def mutate_and_get_payload(cls, args, context, info):
           args['number'] # this raises a errror when i pass in null 

On the JS side my getVariables input is:

 getVariables() {
     return {
        number: null
     };
 }

I would expect calling args['number'] to return None instead of raising an exception if I specifically supply null as my input

Is this the desired behavior, or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions