I have created the PreferencesNode from the DjangoObjectType which contains the gateway provider as TextChoices.
class GatewayProvider(models.TextChoices):
STRIPE = "stripe", "Stripe"
RAZORPAY = "razorpay", "Razorpay"
class PreferencesNode(DjangoObjectType):
class Meta:
model = Preferences
exclude_fields = ("user_id",)
Now I want to use AccountPreferencesGatewayProviderChoices enum (created via PreferencesNode). How can I do this?
Currently I am creating another enum inheriting graphene.Enum.
class GatewayProviderEnum(graphene.Enum):
STRIPE = GatewayProvider.STRIPE.value
RAZORPAY = GatewayProvider.RAZORPAY.value
But this is creating redundant enum type.
Here I am asking the question. How can I use the AccountPreferencesGatewayProviderChoices enumeration which is created through DjangoObjectType, in the different mutation or query as argument without redefining the type?
