mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-22 05:49:59 +03:00
fix: Argument default value should be undefined
This commit is contained in:
parent
2e87ebe5fc
commit
ab95170eea
|
@ -1,5 +1,7 @@
|
|||
from itertools import chain
|
||||
|
||||
from graphql import Undefined
|
||||
|
||||
from .dynamic import Dynamic
|
||||
from .mountedtype import MountedType
|
||||
from .structures import NonNull
|
||||
|
@ -41,7 +43,7 @@ class Argument(MountedType):
|
|||
def __init__(
|
||||
self,
|
||||
type_,
|
||||
default_value=None,
|
||||
default_value=Undefined,
|
||||
description=None,
|
||||
name=None,
|
||||
required=False,
|
||||
|
@ -102,9 +104,7 @@ def to_arguments(args, extra_args=None):
|
|||
raise ValueError(f'Unknown argument "{default_name}".')
|
||||
|
||||
arg_name = default_name or arg.name
|
||||
assert (
|
||||
arg_name not in arguments
|
||||
), f'More than one Argument have same name "{arg_name}".'
|
||||
assert arg_name not in arguments, f'More than one Argument have same name "{arg_name}".'
|
||||
arguments[arg_name] = arg
|
||||
|
||||
return arguments
|
||||
|
|
Loading…
Reference in New Issue
Block a user