diff --git a/bd_api/apps/payment/graphql.py b/bd_api/apps/payment/graphql.py index fc0cdd38..c2ac10d7 100644 --- a/bd_api/apps/payment/graphql.py +++ b/bd_api/apps/payment/graphql.py @@ -25,6 +25,8 @@ class StripePriceNode(DjangoObjectType): _id = ID(name="_id") amount = Float() product_name = String() + product_slug = String() + product_slots = String() class Meta: model = DJStripePrice @@ -42,6 +44,12 @@ def resolve_amount(root, info): def resolve_product_name(root, info): return root.product.name + def resolve_product_slug(root, info): + return root.product.metadata.get("code", "") + + def resolve_product_slots(root, info): + return root.product.metadata.get("slots", "0") + class StripePriceQuery(ObjectType): stripe_price = PlainTextNode.Field(StripePriceNode)