Skip to content

Commit

Permalink
feat(hydrogen-react): include applicable in discountCode in default… (
Browse files Browse the repository at this point in the history
Shopify#1040)

* feat(hydrogen-react): include `applicable` in discountCode in defaultCartFragment

The `useCart` hook from hydrogen-react uses the defaultCartFragment if not specified otherwise. Developers, when using discountCodes, will often want to know is the code is valid.
  • Loading branch information
pnodet authored and FrcPpe committed Aug 13, 2023
1 parent e6c2653 commit 61142ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-points-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen-react': patch
---

Add discountCode.applicable in default Cart fragment
1 change: 1 addition & 0 deletions packages/hydrogen-react/src/cart-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export const defaultCartFragment = /* GraphQL */ `
}
discountCodes {
code
applicable
}
}
Expand Down

0 comments on commit 61142ef

Please sign in to comment.