Skip to content

Undefined arguments always passed to resolvers #1398

Closed
@stabacco

Description

@stabacco

Contrarily to what's described here: it looks like all the arguments with unset values are passed to the resolvers in graphene-3:

This is the query i am defining

class Query(graphene.ObjectType):

    hello = graphene.String(required=True, name=graphene.String())

    def resolve_hello(parent, info, **kwargs):
        return str(kwargs)

which i submit as

{
    hello
}

The result is :

{
    "data": {
        "hello": "{'name': None}"
    }
}

The expected returned value is :

{
    "data": {
        "hello": "{}"
    }
}

which is what we're getting with graphene-2.

My environment:

graphene==3.0
graphql-core==3.1.7
graphql-relay==3.1.0
graphql-server==3.0.0b4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions