`create_type` Throws error of field not having a name
Opened this issue · 2 comments
jakubikan commented
Describe the Bug
ValueError: Field doesn't have a name. Fields passed to create_type
must define a name by passing the name
argument to strawberry.field
.
It seems like that there is an issue when using create_type and passing fields.
Looking at the code here it uses python_name
which seems to be hardcoded to None here
strawberry/strawberry/field.py
Line 514 in ec4cf15
System Information
- Operating system: Mac
- Strawberry version (if applicable): 0.221.1
Additional Context
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
patrick91 commented
@jakubikan can you show us an example of the code that triggers this issue? 😊
jakubikan commented
It basically happens when you don't pass a resolver to field
my_name = strawberry.field(name="myName")
query = create_type(f"Query", [my_name])