Skip to content

Required/NonNull parameters do not work #1394

Closed
@Tomms93

Description

@Tomms93

Required=True and NonNull parameters do not work in Query.
I have tried 3 following ways:
hello2 = String(name=String(required=True))
hello2 = String(name=NonNull(String))
hello2 = String(name=Argument(String, required=True))

with following resolver:
def resolve_hello2(root, info, name):
return f"Hello {name}!"

And in any of these ways, when I do not provide name, I do not get any error:

image

Although playground seems to recognize that 'hello2' need some parameters, because it is underlined, where 'hello' is not (it does not have any mandatory parameters):

image

Graphene version:
graphene 3.0
graphql-core 3.1.6
graphql-relay 3.1.0

Running API using starlette_graphene3:
starlette-graphene3 0.5.1

Also tested running API using starlette.graphql - the same behavior.

Python: 3.8.10

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