@tiledev/sdk-shopify 0.2.7 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cart.d.ts.map +1 -1
- package/dist/cart.js +25 -7
- package/dist/cart.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/collections.js +1 -1
- package/dist/collections.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/metafields.d.ts +38 -0
- package/dist/metafields.d.ts.map +1 -0
- package/dist/metafields.js +109 -0
- package/dist/metafields.js.map +1 -0
- package/dist/products.d.ts.map +1 -1
- package/dist/products.js +8 -6
- package/dist/products.js.map +1 -1
- package/dist/queries.d.ts +32 -20
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +59 -29
- package/dist/queries.js.map +1 -1
- package/dist/react/ShopifyProvider.d.ts +12 -2
- package/dist/react/ShopifyProvider.d.ts.map +1 -1
- package/dist/react/ShopifyProvider.js +39 -7
- package/dist/react/ShopifyProvider.js.map +1 -1
- package/dist/types.d.ts +50 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/wishlist.js +1 -1
- package/dist/wishlist.js.map +1 -1
- package/package.json +2 -2
package/dist/queries.d.ts
CHANGED
|
@@ -6,26 +6,37 @@ export declare const VARIANT_FRAGMENT = "\n \n fragment MoneyFields on MoneyV2
|
|
|
6
6
|
* reduced to content types, which is all a grid asks of it (the play badge), rather than every
|
|
7
7
|
* product in the grid carrying video sources and preview images. `ProductFields` has both.
|
|
8
8
|
*/
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
9
|
+
export declare const productCardFragment: () => string;
|
|
10
|
+
export declare const productFragment: () => string;
|
|
11
11
|
export declare const COLLECTION_FRAGMENT = "\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment CollectionFields on Collection {\n id\n handle\n title\n description\n descriptionHtml\n image { ...ImageFields }\n }\n";
|
|
12
|
-
export declare const CART_FRAGMENT = "\n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n";
|
|
12
|
+
export declare const CART_FRAGMENT = "\n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n";
|
|
13
13
|
export declare const ADDRESS_FRAGMENT = "\n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n";
|
|
14
14
|
export declare const CUSTOMER_FRAGMENT = "\n \n fragment AddressFields on MailingAddress {\n id\n firstName\n lastName\n address1\n address2\n city\n province\n country\n zip\n phone\n }\n\n fragment CustomerFields on Customer {\n id\n email\n firstName\n lastName\n phone\n acceptsMarketing\n defaultAddress { ...AddressFields }\n }\n";
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
15
|
+
export declare const productsListQuery: () => string;
|
|
16
|
+
export declare const productByHandleQuery: () => string;
|
|
17
|
+
export declare const productByIdQuery: () => string;
|
|
18
|
+
export declare const productRecommendationsQuery: () => string;
|
|
19
19
|
export declare const COLLECTIONS_LIST_QUERY = "\n \n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment CollectionFields on Collection {\n id\n handle\n title\n description\n descriptionHtml\n image { ...ImageFields }\n }\n\n query Collections($first: Int!, $after: String, $query: String, $sortKey: CollectionSortKeys, $reverse: Boolean) {\n collections(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) {\n nodes { ...CollectionFields }\n pageInfo { hasNextPage hasPreviousPage startCursor endCursor }\n }\n }\n";
|
|
20
20
|
export declare const COLLECTION_BY_HANDLE_QUERY = "\n \n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment CollectionFields on Collection {\n id\n handle\n title\n description\n descriptionHtml\n image { ...ImageFields }\n }\n\n query CollectionByHandle($handle: String!) {\n collection(handle: $handle) { ...CollectionFields }\n }\n";
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const CART_CREATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartCreate($input: CartInput) {\n cartCreate(input: $input) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
24
|
-
export declare const CART_GET_QUERY = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n query CartGet($id: ID!) {\n cart(id: $id) { ...CartFields }\n }\n";
|
|
25
|
-
export declare const CART_LINES_ADD_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
26
|
-
export declare const CART_LINES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
27
|
-
export declare const CART_LINES_REMOVE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
28
|
-
|
|
21
|
+
export declare const collectionProductsQuery: () => string;
|
|
22
|
+
export declare const searchProductsQuery: () => string;
|
|
23
|
+
export declare const CART_CREATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartCreate($input: CartInput) {\n cartCreate(input: $input) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
24
|
+
export declare const CART_GET_QUERY = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n query CartGet($id: ID!) {\n cart(id: $id) { ...CartFields }\n }\n";
|
|
25
|
+
export declare const CART_LINES_ADD_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
26
|
+
export declare const CART_LINES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
27
|
+
export declare const CART_LINES_REMOVE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
28
|
+
/**
|
|
29
|
+
* The cart's discount codes — the whole set, not an addition: this REPLACES whatever the cart
|
|
30
|
+
* carries, so a caller adding one has to send the existing ones back alongside it.
|
|
31
|
+
*
|
|
32
|
+
* **`discountCodes` is `[String!]!`, not `[String!]`.** Same trap as `$note` below, and it bit
|
|
33
|
+
* harder because it is less obviously a required field: a nullable variable is rejected outright
|
|
34
|
+
* with `Nullability mismatch on variable $discountCodes and argument discountCodes
|
|
35
|
+
* ([String!] / [String!]!)`, and Shopify refuses the document before reading its variables — so
|
|
36
|
+
* EVERY code failed, valid or not, on every app built on this SDK. Clearing the set is `[]`, which
|
|
37
|
+
* is a value rather than a null, so nothing is lost by requiring it.
|
|
38
|
+
*/
|
|
39
|
+
export declare const CART_DISCOUNT_CODES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
29
40
|
/**
|
|
30
41
|
* The shopper's order note. It rides the cart to the order, where the merchant reads it beside the
|
|
31
42
|
* line items — so it is content, not a cart attribute, and Shopify gives it its own mutation.
|
|
@@ -35,10 +46,11 @@ export declare const CART_DISCOUNT_CODES_UPDATE_MUTATION = "\n \n \n \n frag
|
|
|
35
46
|
* not a case that only shows up when clearing. Clearing is the empty string, which is also what a
|
|
36
47
|
* cart with no note reads back as.
|
|
37
48
|
*/
|
|
38
|
-
export declare const
|
|
39
|
-
export declare const
|
|
40
|
-
export declare const
|
|
41
|
-
export declare const
|
|
49
|
+
export declare const CART_ATTRIBUTES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartAttributesUpdate($cartId: ID!, $attributes: [AttributeInput!]!) {\n cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
50
|
+
export declare const CART_NOTE_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartNoteUpdate($cartId: ID!, $note: String!) {\n cartNoteUpdate(cartId: $cartId, note: $note) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
51
|
+
export declare const CART_BUYER_IDENTITY_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartBuyerIdentityUpdate($cartId: ID!, $buyerIdentity: CartBuyerIdentityInput!) {\n cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
52
|
+
export declare const CART_GIFT_CARD_CODES_UPDATE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartGiftCardCodesUpdate($cartId: ID!, $giftCardCodes: [String!]!) {\n cartGiftCardCodesUpdate(cartId: $cartId, giftCardCodes: $giftCardCodes) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
53
|
+
export declare const CART_GIFT_CARD_CODES_REMOVE_MUTATION = "\n \n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n fragment CartFields on Cart {\n id\n checkoutUrl\n totalQuantity\n note\n attributes { key value }\n buyerIdentity { countryCode email phone }\n cost {\n subtotalAmount { ...MoneyFields }\n totalAmount { ...MoneyFields }\n totalTaxAmount { ...MoneyFields }\n checkoutChargeAmount { ...MoneyFields }\n }\n discountCodes { code applicable }\n appliedGiftCards {\n id\n lastCharacters\n presentmentAmountUsed { ...MoneyFields }\n balance { ...MoneyFields }\n amountUsed { ...MoneyFields }\n }\n createdAt\n updatedAt\n lines(first: 250) {\n nodes {\n id\n quantity\n attributes { key value }\n cost {\n totalAmount { ...MoneyFields }\n amountPerQuantity { ...MoneyFields }\n compareAtAmountPerQuantity { ...MoneyFields }\n }\n merchandise {\n ... on ProductVariant {\n ...VariantFields\n product { id title handle }\n }\n }\n }\n }\n }\n\n mutation CartGiftCardCodesRemove($cartId: ID!, $appliedGiftCardIds: [ID!]!) {\n cartGiftCardCodesRemove(cartId: $cartId, appliedGiftCardIds: $appliedGiftCardIds) {\n cart { ...CartFields }\n userErrors { field message code }\n }\n }\n";
|
|
42
54
|
/** Shop's IP-localized country (e.g. `"US"`). We use this as the fallback
|
|
43
55
|
* countryCode when applying a gift card so the cart has a payment tender. */
|
|
44
56
|
export declare const SHOP_LOCALIZATION_QUERY = "\n query ShopLocalization {\n localization {\n country { isoCode name }\n }\n }\n";
|
|
@@ -58,7 +70,7 @@ export declare const BLOG_BY_HANDLE_QUERY = "\n \n fragment BlogFields on Blog
|
|
|
58
70
|
export declare const BLOG_ARTICLES_QUERY = "\n \n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n \n fragment BlogFields on Blog {\n id\n handle\n title\n }\n\n fragment ArticleFields on Article {\n id\n handle\n title\n content\n contentHtml\n excerpt\n excerptHtml\n publishedAt\n tags\n image { ...ImageFields }\n authorV2 {\n name\n email\n bio\n }\n blog { ...BlogFields }\n }\n\n query BlogArticles($handle: String!, $first: Int!, $after: String, $sortKey: ArticleSortKeys, $reverse: Boolean) {\n blog(handle: $handle) {\n articles(first: $first, after: $after, sortKey: $sortKey, reverse: $reverse) {\n nodes { ...ArticleFields }\n pageInfo { hasNextPage hasPreviousPage startCursor endCursor }\n }\n }\n }\n";
|
|
59
71
|
export declare const BLOG_ARTICLE_BY_HANDLE_QUERY = "\n \n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n \n fragment BlogFields on Blog {\n id\n handle\n title\n }\n\n fragment ArticleFields on Article {\n id\n handle\n title\n content\n contentHtml\n excerpt\n excerptHtml\n publishedAt\n tags\n image { ...ImageFields }\n authorV2 {\n name\n email\n bio\n }\n blog { ...BlogFields }\n }\n\n query BlogArticleByHandle($blogHandle: String!, $articleHandle: String!) {\n blog(handle: $blogHandle) {\n articleByHandle(handle: $articleHandle) { ...ArticleFields }\n }\n }\n";
|
|
60
72
|
/** Deleted or access-denied products come back as `null`, position-preserved. */
|
|
61
|
-
export declare const
|
|
73
|
+
export declare const nodesAsProductsQuery: () => string;
|
|
62
74
|
export declare const SHOP_QUERY = "\n query ShopInfo {\n shop {\n name\n moneyFormat\n paymentSettings {\n currencyCode\n }\n }\n }\n";
|
|
63
75
|
/** Each variant carries enough of its parent product to render a card without a second trip. */
|
|
64
76
|
export declare const NODES_AS_VARIANTS_QUERY = "\n \n \n fragment MoneyFields on MoneyV2 {\n amount\n currencyCode\n }\n\n \n fragment ImageFields on Image {\n url\n altText\n width\n height\n }\n\n fragment VariantFields on ProductVariant {\n id\n title\n sku\n availableForSale\n quantityAvailable\n price { ...MoneyFields }\n compareAtPrice { ...MoneyFields }\n selectedOptions { name value }\n image { ...ImageFields }\n }\n\n query VariantNodes($ids: [ID!]!) {\n nodes(ids: $ids) {\n __typename\n ... on ProductVariant {\n ...VariantFields\n sellingPlanAllocations(first: 1) {\n nodes {\n sellingPlan { id name }\n remainingBalanceChargeAmount { ...MoneyFields }\n }\n }\n product {\n id\n title\n handle\n featuredImage { ...ImageFields }\n media(first: 250) { nodes { mediaContentType } }\n }\n }\n }\n }\n";
|
package/dist/queries.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,+EAK1B,CAAC;AAEF,eAAO,MAAM,cAAc,4FAO1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mbAc5B,CAAC;AAwCF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,cAM/B,CAAC;AAEF,eAAO,MAAM,eAAe,cAiB3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,uPAU/B,CAAC;AAEF,eAAO,MAAM,aAAa,oiDA6CzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,oLAa5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,kWAW7B,CAAC;AAIF,eAAO,MAAM,iBAAiB,cAQ5B,CAAC;AAEH,eAAO,MAAM,oBAAoB,cAK/B,CAAC;AAEH,eAAO,MAAM,gBAAgB,cAK3B,CAAC;AAEH,eAAO,MAAM,2BAA2B,cAKtC,CAAC;AAEH,eAAO,MAAM,sBAAsB,glBAQlC,CAAC;AAEF,eAAO,MAAM,0BAA0B,2WAKtC,CAAC;AAEF,eAAO,MAAM,uBAAuB,cAkBlC,CAAC;AAEH,eAAO,MAAM,mBAAmB,cAiC9B,CAAC;AAEH,eAAO,MAAM,oBAAoB,0sDAQhC,C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AAEF,gGAAgG;AAChG,eAAO,MAAM,uBAAuB,u8BAuBnC,CAAC"}
|
package/dist/queries.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NODES_AS_VARIANTS_QUERY = exports.SHOP_QUERY = exports.
|
|
3
|
+
exports.NODES_AS_VARIANTS_QUERY = exports.SHOP_QUERY = exports.nodesAsProductsQuery = exports.BLOG_ARTICLE_BY_HANDLE_QUERY = exports.BLOG_ARTICLES_QUERY = exports.BLOG_BY_HANDLE_QUERY = exports.BLOGS_LIST_QUERY = exports.ARTICLE_FRAGMENT = exports.BLOG_FRAGMENT = exports.CUSTOMER_ORDER_BY_ID_QUERY = exports.CUSTOMER_ORDERS_QUERY = exports.ORDER_FRAGMENT = exports.CUSTOMER_UPDATE_MUTATION = exports.CUSTOMER_RECOVER_MUTATION = exports.CUSTOMER_QUERY = exports.CUSTOMER_ACCESS_TOKEN_DELETE_MUTATION = exports.CUSTOMER_ACCESS_TOKEN_CREATE_MUTATION = exports.CUSTOMER_CREATE_MUTATION = exports.SHOP_LOCALIZATION_QUERY = exports.CART_GIFT_CARD_CODES_REMOVE_MUTATION = exports.CART_GIFT_CARD_CODES_UPDATE_MUTATION = exports.CART_BUYER_IDENTITY_UPDATE_MUTATION = exports.CART_NOTE_UPDATE_MUTATION = exports.CART_ATTRIBUTES_UPDATE_MUTATION = exports.CART_DISCOUNT_CODES_UPDATE_MUTATION = exports.CART_LINES_REMOVE_MUTATION = exports.CART_LINES_UPDATE_MUTATION = exports.CART_LINES_ADD_MUTATION = exports.CART_GET_QUERY = exports.CART_CREATE_MUTATION = exports.searchProductsQuery = exports.collectionProductsQuery = exports.COLLECTION_BY_HANDLE_QUERY = exports.COLLECTIONS_LIST_QUERY = exports.productRecommendationsQuery = exports.productByIdQuery = exports.productByHandleQuery = exports.productsListQuery = exports.CUSTOMER_FRAGMENT = exports.ADDRESS_FRAGMENT = exports.CART_FRAGMENT = exports.COLLECTION_FRAGMENT = exports.productFragment = exports.productCardFragment = exports.VARIANT_FRAGMENT = exports.IMAGE_FRAGMENT = exports.MONEY_FRAGMENT = void 0;
|
|
4
|
+
const metafields_1 = require("./metafields");
|
|
4
5
|
exports.MONEY_FRAGMENT = `
|
|
5
6
|
fragment MoneyFields on MoneyV2 {
|
|
6
7
|
amount
|
|
@@ -30,10 +31,16 @@ exports.VARIANT_FRAGMENT = `
|
|
|
30
31
|
image { ...ImageFields }
|
|
31
32
|
}
|
|
32
33
|
`;
|
|
33
|
-
/**
|
|
34
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Every product field except media, which is where the card and gallery selections diverge.
|
|
36
|
+
*
|
|
37
|
+
* Built on demand rather than held as a const: the metafield selection depends on what the app
|
|
38
|
+
* configured, which happens after this module is imported.
|
|
39
|
+
*/
|
|
40
|
+
const productCoreFragment = () => /* GraphQL */ `
|
|
35
41
|
${exports.VARIANT_FRAGMENT}
|
|
36
42
|
fragment ProductCoreFields on Product {
|
|
43
|
+
${(0, metafields_1.metafieldSelection)()}
|
|
37
44
|
id
|
|
38
45
|
handle
|
|
39
46
|
title
|
|
@@ -66,15 +73,16 @@ const PRODUCT_CORE_FRAGMENT = /* GraphQL */ `
|
|
|
66
73
|
* reduced to content types, which is all a grid asks of it (the play badge), rather than every
|
|
67
74
|
* product in the grid carrying video sources and preview images. `ProductFields` has both.
|
|
68
75
|
*/
|
|
69
|
-
|
|
70
|
-
${
|
|
76
|
+
const productCardFragment = () => /* GraphQL */ `
|
|
77
|
+
${productCoreFragment()}
|
|
71
78
|
fragment ProductCardFields on Product {
|
|
72
79
|
...ProductCoreFields
|
|
73
80
|
media(first: 250) { nodes { mediaContentType } }
|
|
74
81
|
}
|
|
75
82
|
`;
|
|
76
|
-
exports.
|
|
77
|
-
|
|
83
|
+
exports.productCardFragment = productCardFragment;
|
|
84
|
+
const productFragment = () => /* GraphQL */ `
|
|
85
|
+
${productCoreFragment()}
|
|
78
86
|
fragment ProductFields on Product {
|
|
79
87
|
...ProductCoreFields
|
|
80
88
|
# Videos are appended after images, so a small window misses them entirely.
|
|
@@ -91,6 +99,7 @@ exports.PRODUCT_FRAGMENT = `
|
|
|
91
99
|
}
|
|
92
100
|
}
|
|
93
101
|
`;
|
|
102
|
+
exports.productFragment = productFragment;
|
|
94
103
|
exports.COLLECTION_FRAGMENT = `
|
|
95
104
|
${exports.IMAGE_FRAGMENT}
|
|
96
105
|
fragment CollectionFields on Collection {
|
|
@@ -110,6 +119,7 @@ exports.CART_FRAGMENT = `
|
|
|
110
119
|
checkoutUrl
|
|
111
120
|
totalQuantity
|
|
112
121
|
note
|
|
122
|
+
attributes { key value }
|
|
113
123
|
buyerIdentity { countryCode email phone }
|
|
114
124
|
cost {
|
|
115
125
|
subtotalAmount { ...MoneyFields }
|
|
@@ -174,33 +184,33 @@ exports.CUSTOMER_FRAGMENT = `
|
|
|
174
184
|
}
|
|
175
185
|
`;
|
|
176
186
|
// Operations
|
|
177
|
-
exports.
|
|
178
|
-
${exports.
|
|
187
|
+
exports.productsListQuery = (0, metafields_1.memoizeQuery)(() => /* GraphQL */ `
|
|
188
|
+
${(0, exports.productFragment)()}
|
|
179
189
|
query Products($first: Int!, $after: String, $query: String, $sortKey: ProductSortKeys, $reverse: Boolean) {
|
|
180
190
|
products(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) {
|
|
181
191
|
nodes { ...ProductFields }
|
|
182
192
|
pageInfo { hasNextPage hasPreviousPage startCursor endCursor }
|
|
183
193
|
}
|
|
184
194
|
}
|
|
185
|
-
|
|
186
|
-
exports.
|
|
187
|
-
${exports.
|
|
195
|
+
`);
|
|
196
|
+
exports.productByHandleQuery = (0, metafields_1.memoizeQuery)(() => /* GraphQL */ `
|
|
197
|
+
${(0, exports.productFragment)()}
|
|
188
198
|
query ProductByHandle($handle: String!) {
|
|
189
199
|
product(handle: $handle) { ...ProductFields }
|
|
190
200
|
}
|
|
191
|
-
|
|
192
|
-
exports.
|
|
193
|
-
${exports.
|
|
201
|
+
`);
|
|
202
|
+
exports.productByIdQuery = (0, metafields_1.memoizeQuery)(() => /* GraphQL */ `
|
|
203
|
+
${(0, exports.productFragment)()}
|
|
194
204
|
query ProductById($id: ID!) {
|
|
195
205
|
product(id: $id) { ...ProductFields }
|
|
196
206
|
}
|
|
197
|
-
|
|
198
|
-
exports.
|
|
199
|
-
${exports.
|
|
207
|
+
`);
|
|
208
|
+
exports.productRecommendationsQuery = (0, metafields_1.memoizeQuery)(() => /* GraphQL */ `
|
|
209
|
+
${(0, exports.productCardFragment)()}
|
|
200
210
|
query Recommended($productId: ID!) {
|
|
201
211
|
productRecommendations(productId: $productId) { ...ProductCardFields }
|
|
202
212
|
}
|
|
203
|
-
|
|
213
|
+
`);
|
|
204
214
|
exports.COLLECTIONS_LIST_QUERY = `
|
|
205
215
|
${exports.COLLECTION_FRAGMENT}
|
|
206
216
|
query Collections($first: Int!, $after: String, $query: String, $sortKey: CollectionSortKeys, $reverse: Boolean) {
|
|
@@ -216,8 +226,8 @@ exports.COLLECTION_BY_HANDLE_QUERY = `
|
|
|
216
226
|
collection(handle: $handle) { ...CollectionFields }
|
|
217
227
|
}
|
|
218
228
|
`;
|
|
219
|
-
exports.
|
|
220
|
-
${exports.
|
|
229
|
+
exports.collectionProductsQuery = (0, metafields_1.memoizeQuery)(() => /* GraphQL */ `
|
|
230
|
+
${(0, exports.productCardFragment)()}
|
|
221
231
|
query CollectionProducts($handle: String!, $first: Int!, $after: String, $sortKey: ProductCollectionSortKeys, $reverse: Boolean, $filters: [ProductFilter!]) {
|
|
222
232
|
collection(handle: $handle) {
|
|
223
233
|
handle
|
|
@@ -234,9 +244,9 @@ exports.COLLECTION_PRODUCTS_QUERY = `
|
|
|
234
244
|
}
|
|
235
245
|
}
|
|
236
246
|
}
|
|
237
|
-
|
|
238
|
-
exports.
|
|
239
|
-
${exports.
|
|
247
|
+
`);
|
|
248
|
+
exports.searchProductsQuery = (0, metafields_1.memoizeQuery)(() => /* GraphQL */ `
|
|
249
|
+
${(0, exports.productCardFragment)()}
|
|
240
250
|
query SearchProducts(
|
|
241
251
|
$query: String!
|
|
242
252
|
$first: Int!
|
|
@@ -268,7 +278,7 @@ exports.SEARCH_PRODUCTS_QUERY = `
|
|
|
268
278
|
}
|
|
269
279
|
}
|
|
270
280
|
}
|
|
271
|
-
|
|
281
|
+
`);
|
|
272
282
|
exports.CART_CREATE_MUTATION = `
|
|
273
283
|
${exports.CART_FRAGMENT}
|
|
274
284
|
mutation CartCreate($input: CartInput) {
|
|
@@ -311,9 +321,20 @@ exports.CART_LINES_REMOVE_MUTATION = `
|
|
|
311
321
|
}
|
|
312
322
|
}
|
|
313
323
|
`;
|
|
324
|
+
/**
|
|
325
|
+
* The cart's discount codes — the whole set, not an addition: this REPLACES whatever the cart
|
|
326
|
+
* carries, so a caller adding one has to send the existing ones back alongside it.
|
|
327
|
+
*
|
|
328
|
+
* **`discountCodes` is `[String!]!`, not `[String!]`.** Same trap as `$note` below, and it bit
|
|
329
|
+
* harder because it is less obviously a required field: a nullable variable is rejected outright
|
|
330
|
+
* with `Nullability mismatch on variable $discountCodes and argument discountCodes
|
|
331
|
+
* ([String!] / [String!]!)`, and Shopify refuses the document before reading its variables — so
|
|
332
|
+
* EVERY code failed, valid or not, on every app built on this SDK. Clearing the set is `[]`, which
|
|
333
|
+
* is a value rather than a null, so nothing is lost by requiring it.
|
|
334
|
+
*/
|
|
314
335
|
exports.CART_DISCOUNT_CODES_UPDATE_MUTATION = `
|
|
315
336
|
${exports.CART_FRAGMENT}
|
|
316
|
-
mutation CartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
|
|
337
|
+
mutation CartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {
|
|
317
338
|
cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
|
|
318
339
|
cart { ...CartFields }
|
|
319
340
|
userErrors { field message code }
|
|
@@ -329,6 +350,15 @@ exports.CART_DISCOUNT_CODES_UPDATE_MUTATION = `
|
|
|
329
350
|
* not a case that only shows up when clearing. Clearing is the empty string, which is also what a
|
|
330
351
|
* cart with no note reads back as.
|
|
331
352
|
*/
|
|
353
|
+
exports.CART_ATTRIBUTES_UPDATE_MUTATION = `
|
|
354
|
+
${exports.CART_FRAGMENT}
|
|
355
|
+
mutation CartAttributesUpdate($cartId: ID!, $attributes: [AttributeInput!]!) {
|
|
356
|
+
cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {
|
|
357
|
+
cart { ...CartFields }
|
|
358
|
+
userErrors { field message code }
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
`;
|
|
332
362
|
exports.CART_NOTE_UPDATE_MUTATION = `
|
|
333
363
|
${exports.CART_FRAGMENT}
|
|
334
364
|
mutation CartNoteUpdate($cartId: ID!, $note: String!) {
|
|
@@ -555,15 +585,15 @@ exports.BLOG_ARTICLE_BY_HANDLE_QUERY = `
|
|
|
555
585
|
`;
|
|
556
586
|
// Wishlist — batch product hydration by ID
|
|
557
587
|
/** Deleted or access-denied products come back as `null`, position-preserved. */
|
|
558
|
-
exports.
|
|
559
|
-
${exports.
|
|
588
|
+
exports.nodesAsProductsQuery = (0, metafields_1.memoizeQuery)(() => /* GraphQL */ `
|
|
589
|
+
${(0, exports.productCardFragment)()}
|
|
560
590
|
query WishlistNodes($ids: [ID!]!) {
|
|
561
591
|
nodes(ids: $ids) {
|
|
562
592
|
__typename
|
|
563
593
|
... on Product { ...ProductCardFields }
|
|
564
594
|
}
|
|
565
595
|
}
|
|
566
|
-
|
|
596
|
+
`);
|
|
567
597
|
exports.SHOP_QUERY = `
|
|
568
598
|
query ShopInfo {
|
|
569
599
|
shop {
|
package/dist/queries.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources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;;;;CAMnB,CAAC;AAEF,2CAA2C;AAE3C,iFAAiF;AACpE,QAAA,oBAAoB,GAAG,IAAA,yBAAY,EAAC,GAAG,EAAE,CAAC,aAAa,CAAC;IACjE,IAAA,2BAAmB,GAAE;;;;;;;CAOxB,CAAC,CAAC;AAEU,QAAA,UAAU,GAAiB;;;;;;;;;;CAUvC,CAAC;AAEF,gGAAgG;AACnF,QAAA,uBAAuB,GAAiB;IACjD,wBAAgB;;;;;;;;;;;;;;;;;;;;;;CAsBnB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import type { AlertMessageKey, AlertMessages, Cart, CartLineAttribute, CartLineGuard, CartLineInput, CartPolicy, CartWriteResult, Customer, MessageResolver, Product, ShopifyConfig, WishlistItem, WishlistStorageAdapter } from "../types";
|
|
2
|
+
import type { AlertMessageKey, AlertMessages, Cart, CartAttribute, CartLineAttribute, CartLineGuard, CartLineInput, CartPolicy, CartWriteResult, Customer, MessageResolver, Product, ShopifyConfig, WishlistItem, WishlistStorageAdapter } from "../types";
|
|
3
3
|
interface CartState {
|
|
4
4
|
cart: Cart | null;
|
|
5
5
|
loading: boolean;
|
|
@@ -170,8 +170,18 @@ export interface ShopifyProviderProps {
|
|
|
170
170
|
translate?: MessageResolver;
|
|
171
171
|
/** Cart rules. Live-updatable for the same reason. */
|
|
172
172
|
cartPolicy?: CartPolicy;
|
|
173
|
+
/**
|
|
174
|
+
* Attributes stamped on every cart this provider creates, and backfilled onto a stored cart that
|
|
175
|
+
* predates them. They reach the order as its `customAttributes`.
|
|
176
|
+
*
|
|
177
|
+
* On the provider because the cart is created here — during hydration, on the first add, and on
|
|
178
|
+
* reset — with no screen involved, so a caller has nowhere else to set them. A host that needs
|
|
179
|
+
* the order to identify the app it came from (an app-only discount function, an order webhook)
|
|
180
|
+
* sets it here or the cart goes out anonymous.
|
|
181
|
+
*/
|
|
182
|
+
cartAttributes?: CartAttribute[];
|
|
173
183
|
}
|
|
174
|
-
export declare function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishlistKeepDeleted, messages, translate, cartPolicy, }: ShopifyProviderProps): import("react").JSX.Element;
|
|
184
|
+
export declare function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishlistKeepDeleted, messages, translate, cartPolicy, cartAttributes, }: ShopifyProviderProps): import("react").JSX.Element;
|
|
175
185
|
export declare function useShopify(): ShopifyContextType;
|
|
176
186
|
export declare function useCart(): CartState;
|
|
177
187
|
export declare function useWishlist(): WishlistState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShopifyProvider.d.ts","sourceRoot":"","sources":["../../src/react/ShopifyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAOV,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,IAAI,EAEJ,iBAAiB,EACjB,aAAa,EACb,aAAa,EAEb,UAAU,EACV,eAAe,EACf,QAAQ,EAER,eAAe,EACf,OAAO,EACP,aAAa,EACb,YAAY,EACZ,sBAAsB,EACvB,MAAM,UAAU,CAAC;AA4BlB,UAAU,SAAS;IACjB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,OAAO,EAAa,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACvE;;;OAGG;IACH,QAAQ,EAAY,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACtE;;;OAGG;IACH,UAAU,EAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EA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;IACxB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AASD,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,UAAU,EACV,cAAc,GACf,EAAE,oBAAoB,+BAwxBtB;AAED,wBAAgB,UAAU,IAAI,kBAAkB,CAI/C;AAED,wBAAgB,OAAO,IAAI,SAAS,CAEnC;AAED,wBAAgB,WAAW,IAAI,aAAa,CAE3C;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,IAAI,aAAa,CAE3C;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,IAAI,aAAa,CAE3C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,CAAC,GAAG,EAAE,eAAe,KAAK,MAAM,CAEpE;AAED,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -65,7 +65,7 @@ function defaultStorage() {
|
|
|
65
65
|
}
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
|
-
function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishlistKeepDeleted, messages, translate, cartPolicy, }) {
|
|
68
|
+
function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishlistKeepDeleted, messages, translate, cartPolicy, cartAttributes, }) {
|
|
69
69
|
const [ready, setReady] = (0, react_1.useState)(false);
|
|
70
70
|
const [error, setError] = (0, react_1.useState)(null);
|
|
71
71
|
const [cart, setCart] = (0, react_1.useState)(null);
|
|
@@ -230,10 +230,10 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
230
230
|
next = await shopify_1.shopify.cart.get(savedId);
|
|
231
231
|
// A stored cart predates this session, so it may have been created in another market.
|
|
232
232
|
if (next)
|
|
233
|
-
next = await pinMarket(next);
|
|
233
|
+
next = await applyCartAttributes(await pinMarket(next));
|
|
234
234
|
if (!next) {
|
|
235
235
|
// A cart created now is already in the configured market — `@inContext` saw to that.
|
|
236
|
-
next = await shopify_1.shopify.cart.create();
|
|
236
|
+
next = await shopify_1.shopify.cart.create({ attributes: cartAttrsRef.current });
|
|
237
237
|
if (s)
|
|
238
238
|
await Promise.resolve(s.setItem(CART_STORAGE_KEY, next.id));
|
|
239
239
|
}
|
|
@@ -315,6 +315,38 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
315
315
|
*
|
|
316
316
|
* Failure is swallowed: a cart in the wrong currency still beats no cart.
|
|
317
317
|
*/
|
|
318
|
+
/**
|
|
319
|
+
* In a ref so the cart callbacks keep their identity when the host passes a new array each
|
|
320
|
+
* render — the same reason `cartGuard` is held this way.
|
|
321
|
+
*/
|
|
322
|
+
const cartAttrsRef = (0, react_1.useRef)(cartAttributes);
|
|
323
|
+
cartAttrsRef.current = cartAttributes;
|
|
324
|
+
/**
|
|
325
|
+
* Backfills the configured attributes onto a cart that is missing them.
|
|
326
|
+
*
|
|
327
|
+
* A stored cart outlives the build that made it, so a shopper who had a cart before these were
|
|
328
|
+
* configured would otherwise keep an attribute-less cart indefinitely — and cart ids persist for
|
|
329
|
+
* weeks. Existing pairs win: only keys the cart does not already carry are added, so a value the
|
|
330
|
+
* cart set for itself is never overwritten by a default.
|
|
331
|
+
*
|
|
332
|
+
* Failure is swallowed, as in `pinMarket`: a cart missing an attribute still beats no cart.
|
|
333
|
+
*/
|
|
334
|
+
const applyCartAttributes = (0, react_1.useCallback)(async (next) => {
|
|
335
|
+
var _a, _b;
|
|
336
|
+
const wanted = cartAttrsRef.current;
|
|
337
|
+
if (!(wanted === null || wanted === void 0 ? void 0 : wanted.length))
|
|
338
|
+
return next;
|
|
339
|
+
const have = new Set(((_a = next.attributes) !== null && _a !== void 0 ? _a : []).map((a) => a.key));
|
|
340
|
+
const missing = wanted.filter((a) => !have.has(a.key));
|
|
341
|
+
if (!missing.length)
|
|
342
|
+
return next;
|
|
343
|
+
try {
|
|
344
|
+
return await shopify_1.shopify.cart.updateAttributes(next.id, [...((_b = next.attributes) !== null && _b !== void 0 ? _b : []), ...missing]);
|
|
345
|
+
}
|
|
346
|
+
catch {
|
|
347
|
+
return next;
|
|
348
|
+
}
|
|
349
|
+
}, []);
|
|
318
350
|
const pinMarket = (0, react_1.useCallback)(async (next) => {
|
|
319
351
|
var _a, _b;
|
|
320
352
|
const country = config.country;
|
|
@@ -345,7 +377,7 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
345
377
|
const ensureCartId = (0, react_1.useCallback)(async () => {
|
|
346
378
|
if (cart === null || cart === void 0 ? void 0 : cart.id)
|
|
347
379
|
return cart.id;
|
|
348
|
-
const created = await shopify_1.shopify.cart.create();
|
|
380
|
+
const created = await shopify_1.shopify.cart.create({ attributes: cartAttrsRef.current });
|
|
349
381
|
await persistCart(created);
|
|
350
382
|
return created.id;
|
|
351
383
|
}, [cart, persistCart]);
|
|
@@ -598,13 +630,13 @@ function ShopifyProvider({ children, config, storage, onEvent, cartGuard, wishli
|
|
|
598
630
|
const cartAdopt = (0, react_1.useCallback)(async (cartId) => {
|
|
599
631
|
// Adopted from the shopper's other device or the web store, so its market is not ours to assume.
|
|
600
632
|
const fetched = await shopify_1.shopify.cart.get(cartId);
|
|
601
|
-
const next = fetched ? await pinMarket(fetched) : null;
|
|
633
|
+
const next = fetched ? await applyCartAttributes(await pinMarket(fetched)) : null;
|
|
602
634
|
if (next)
|
|
603
635
|
await persistCart(next);
|
|
604
636
|
return next;
|
|
605
|
-
}, [persistCart, pinMarket]);
|
|
637
|
+
}, [persistCart, pinMarket, applyCartAttributes]);
|
|
606
638
|
const cartReset = (0, react_1.useCallback)(async () => {
|
|
607
|
-
const created = await shopify_1.shopify.cart.create();
|
|
639
|
+
const created = await shopify_1.shopify.cart.create({ attributes: cartAttrsRef.current });
|
|
608
640
|
await persistCart(created);
|
|
609
641
|
}, [persistCart]);
|
|
610
642
|
// The wishlist module owns storage and hydration; these just wrap the mutating methods and
|