You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an input class is marked as @oneOf and has a nullable field, it is not possible to actually provide a null value in the query, and the query completely fails.
Describe the Bug
This bug relates to the usage of input classes that implement the @oneOf directive using one_of=True:
I would assume that the one_of parameter directs Strawberry to evaluate if any of the given fields are None and fail if so, even though this is a legitimate input value.
I have provided this minimum working example, which runs using FastAPI. I have also included Poetry's pyproject.toml file so this issue can be replicated with ease:
When an input class is marked as
@oneOf
and has a nullable field, it is not possible to actually provide a null value in the query, and the query completely fails.Describe the Bug
This bug relates to the usage of input classes that implement the
@oneOf
directive usingone_of=True
:As shown, it should be possible to pass a
null
value in the query for thename
field. However, when executing this query:You get this response:
I would assume that the
one_of
parameter directs Strawberry to evaluate if any of the given fields areNone
and fail if so, even though this is a legitimate input value.I have provided this minimum working example, which runs using FastAPI. I have also included Poetry's
pyproject.toml
file so this issue can be replicated with ease:The text was updated successfully, but these errors were encountered: