Open
Description
Strawberry currently uses a newtype for ID
(from str
).
I'm not very familiar with graphql but I can see the reasoning behind this choice: IDs
are supposed to be opaque values that you don't look inside of, but which are serialised as strings.
The drawback of a newtype is that it causes a lot of manual casting when using Strawberry if you have typechecking turned on. For example with a UUID, you must do strawberry.ID(str(a_uuid))
. If you have typing turned off, passing a_uuid
directly works fine.
Perhaps there is some way to make this easier?
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels