Skip to content

Commit

Permalink
Remove MoneyFragment because graphql-js-client adds multiple MoneyFra…
Browse files Browse the repository at this point in the history
…gment definitons when it is included in multiple GQL fragments
  • Loading branch information
melissaluu committed Nov 2, 2022
1 parent 91d80d3 commit 6a8d2ac
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 41 deletions.
15 changes: 10 additions & 5 deletions src/graphql/AppliedGiftCardFragment.graphql
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
fragment AppliedGiftCardFragment on AppliedGiftCard {
amountUsed {
...MoneyFragment
amount
currencyCode
}
amountUsedV2: amountUsed {
...MoneyFragment
amount
currencyCode
}
balance {
...MoneyFragment
amount
currencyCode
}
balanceV2: balance {
...MoneyFragment
amount
currencyCode
}
presentmentAmountUsed {
...MoneyFragment
amount
currencyCode
}
id
lastCharacters
Expand Down
68 changes: 45 additions & 23 deletions src/graphql/CheckoutFragment.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,45 @@ fragment CheckoutFragment on Checkout {
requiresShipping
note
paymentDue {
...MoneyFragment
amount
currencyCode
}
paymentDueV2: paymentDue {
...MoneyFragment
amount
currencyCode
}
webUrl
orderStatusUrl
taxExempt
taxesIncluded
currencyCode
totalTax {
...MoneyFragment
amount
currencyCode
}
totalTaxV2: totalTax {
...MoneyFragment
amount
currencyCode
}
lineItemsSubtotalPrice {
...MoneyFragment
amount
currencyCode
}
subtotalPrice {
...MoneyFragment
amount
currencyCode
}
subtotalPriceV2: subtotalPrice {
...MoneyFragment
amount
currencyCode
}
totalPrice {
...MoneyFragment
amount
currencyCode
}
totalPriceV2: totalPrice {
...MoneyFragment
amount
currencyCode
}
completedAt
createdAt
Expand All @@ -79,10 +88,12 @@ fragment CheckoutFragment on Checkout {
shippingLine {
handle
price {
...MoneyFragment
amount
currencyCode
}
priceV2: price {
...MoneyFragment
amount
currencyCode
}
title
}
Expand All @@ -95,35 +106,45 @@ fragment CheckoutFragment on Checkout {
processedAt
orderNumber
subtotalPrice {
...MoneyFragment
amount
currencyCode
}
subtotalPriceV2: subtotalPrice {
...MoneyFragment
amount
currencyCode
}
totalShippingPrice {
...MoneyFragment
amount
currencyCode
}
totalShippingPriceV2: totalShippingPrice {
...MoneyFragment
amount
currencyCode
}
totalTax {
...MoneyFragment
amount
currencyCode
}
totalTaxV2: totalTax {
...MoneyFragment
amount
currencyCode
}
totalPrice {
...MoneyFragment
amount
currencyCode
}
totalPriceV2: totalPrice {
...MoneyFragment
amount
currencyCode
}
currencyCode
totalRefunded {
...MoneyFragment
amount
currencyCode
}
totalRefundedV2: totalRefunded {
...MoneyFragment
totalRefundedV2: totalRefunded{
amount
currencyCode
}
customerUrl
shippingAddress {
Expand Down Expand Up @@ -170,7 +191,8 @@ fragment CheckoutFragment on Checkout {
}
discountAllocations {
allocatedAmount {
...MoneyFragment
amount
currencyCode
}
discountApplication {
...DiscountApplicationFragment
Expand Down
3 changes: 2 additions & 1 deletion src/graphql/DiscountApplicationFragment.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ fragment DiscountApplicationFragment on DiscountApplication {
targetType
value {
... on MoneyV2 {
...MoneyFragment
amount
currencyCode
}
... on PricingPercentageValue {
percentage
Expand Down
4 changes: 0 additions & 4 deletions src/graphql/MoneyFragment.graphql

This file was deleted.

21 changes: 13 additions & 8 deletions src/graphql/VariantFragment.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@ fragment VariantFragment on ProductVariant {
id
title
price {
...MoneyFragment
amount
currencyCode
}
priceV2: price {
...MoneyFragment
amount
currencyCode
}
weight
available: availableForSale
sku
compareAtPrice {
...MoneyFragment
}
compareAtPriceV2: compareAtPrice {
...MoneyFragment
amount
currencyCode
}
compareAtPriceV2: compareAtPrice {
amount
currencyCode
}
image {
id
src: url
Expand All @@ -29,8 +33,9 @@ fragment VariantFragment on ProductVariant {
value
}
unitPrice {
...MoneyFragment
}
amount
currencyCode
}
unitPriceMeasurement {
measuredType
quantityUnit
Expand Down

0 comments on commit 6a8d2ac

Please sign in to comment.