-
-
Notifications
You must be signed in to change notification settings - Fork 593
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I'm trying to switch to the new Maybe
pattern. However I've encountered it being not compatible with the future annotations.
Describe the Bug
If strawberry input defined in the python module with from __future__ import annotations
line, it will change behavior of instantiating. It will require Maybe
-field to be provided as keyword argument.
from __future__ import annotations
import strawberry
@strawberry.input
class MyInput:
my_value: strawberry.Maybe[str]
@strawberry.type
class Query:
@strawberry.field
def test(self, my_input: MyInput) -> str:
return 'OK'
MyInput() # MyInput.__init__() missing 1 required keyword-only argument: 'my_value'
Without from __future__ import annotations
instantiation will work fine.
This issue also blocks usage of the whole query/mutation with such inputs.
System Information
- Operating system: Ubuntu
- Python version: 3.11.3
- Strawberry version (if applicable): 0.282.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working