Default default_value
should be Undefined
instead of None
in Argument
and Field
#1344
Labels
default_value
should be Undefined
instead of None
in Argument
and Field
#1344
In
graphql-core
, thedefault_value
for aGraphQLArgument
is set toUndefined
if it is not given. This corresponds to the behavior invalue_from_ast
, in which an argument that has not been supplied is given thedefault_value
iff that default is notUndefined
.In other words, if the code specifies a
default_value
for an argument, use it if there is no value provided. If the code does not specify adefault_value
, do not supply a default value if none is provided.Graphene breaks this expectation by setting the
default_value
toNone
if none is provided inArgument
and inField
.This was resolved for
InputField
in #1111, but it should also be changed forArgument
andField
since aField
can be mounted as anArgument
.From that PR:
The text was updated successfully, but these errors were encountered: