Closed deibeljc closed 1 year ago
So far, I've found this to work just fine, like so:
PlayerType = strawberry.enum(models.PlayerTypes)
@strawberry.django.type(models.Player)
class Player:
name: auto
type: PlayerType
@LucidDan, thanks for the tip.
@deibeljc, does this solution work for you?
Works in the proposed way by @LucidDan but should be documented somewhere.
With django 3.0 came the choices model field type See here. It would be nice if this integration converted those values into an enum for us so we don't have to declare the same enum twice and the source of truth can remain the model.
E.G.
Declaration in model
Example usage?
Upvote & Fund