vendure-ecommerce/vendure-plus-issues

[GiftCardPlugin] giftCardTemplates query should return templateId, not just Asset

Closed this issue · 1 comments

The plugin defines this query:

extend type Query {
  giftCardTemplates: [Asset!]!
}

which allows you to display the available template images in the storefront. However, there is no way to access the actual GiftCardTemplate.id, which is what we actually need to pass to the addGiftCardToOrder() mutation in the storefront in order to specify which gift card template to use.

So we should therefore change the query to:

type GiftCardTemplateResult {
  templateId: ID!
  image: Asset!
}
extend type Query {
  giftCardTemplates: [GiftCardTemplateResult!]!
}

Fixed in v1.0.0