Skip to content

Commit

Permalink
feat: add product metadata to price route
Browse files Browse the repository at this point in the history
  • Loading branch information
vncsna committed Jan 25, 2024
1 parent 5d1b03e commit c9522f7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bd_api/apps/payment/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit c9522f7

Please sign in to comment.