Skip to content

Commit 9386156

Browse files
author
Ryan Workman
committed
Update schema.graphql to include CartTransform metafields
1 parent 7702db9 commit 9386156

File tree

3 files changed

+189
-3
lines changed

3 files changed

+189
-3
lines changed

checkout/rust/cart-transform/bundles/schema.graphql

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Attribute {
2424
}
2525

2626
"""
27-
Represents information about the buyer that is interacting with the cart.
27+
Represents information about the buyer that is interacting with the cart. Only set when the buyer is logged in.
2828
"""
2929
type BuyerIdentity {
3030
"""
@@ -72,6 +72,11 @@ type Cart {
7272
"""
7373
cost: CartCost!
7474

75+
"""
76+
A list of lines containing information about the items that can be delivered.
77+
"""
78+
deliverableLines: [DeliverableCartLine!]!
79+
7580
"""
7681
The delivery groups available for the cart based on the buyer's shipping address.
7782
"""
@@ -255,6 +260,26 @@ input CartOperation @oneOf {
255260
merge: MergeOperation
256261
}
257262

263+
"""
264+
A customization which applies cart transformations to the merchandise lines.
265+
"""
266+
type CartTransform implements HasMetafields {
267+
"""
268+
Returns a metafield by namespace and key that belongs to the resource.
269+
"""
270+
metafield(
271+
"""
272+
The key for the metafield.
273+
"""
274+
key: String!
275+
276+
"""
277+
The namespace for the metafield.
278+
"""
279+
namespace: String!
280+
): Metafield
281+
}
282+
258283
"""
259284
Represents information about a company which is also a customer of the shop.
260285
"""
@@ -2533,6 +2558,38 @@ Example values: `"29.99"`, `"29.999"`.
25332558
"""
25342559
scalar Decimal
25352560

2561+
"""
2562+
Represents information about the merchandise in the cart.
2563+
"""
2564+
type DeliverableCartLine {
2565+
"""
2566+
Retrieve a cart line attribute by key.
2567+
2568+
Cart line attributes are also known as line item properties in Liquid.
2569+
"""
2570+
attribute(
2571+
"""
2572+
The key of the attribute to retrieve.
2573+
"""
2574+
key: String
2575+
): Attribute
2576+
2577+
"""
2578+
The ID of the cart line.
2579+
"""
2580+
id: ID!
2581+
2582+
"""
2583+
The merchandise that the buyer intends to purchase.
2584+
"""
2585+
merchandise: Merchandise!
2586+
2587+
"""
2588+
The quantity of the merchandise that the customer intends to purchase.
2589+
"""
2590+
quantity: Int!
2591+
}
2592+
25362593
"""
25372594
List of different delivery method types.
25382595
"""
@@ -2710,6 +2767,11 @@ type Input {
27102767
The cart.
27112768
"""
27122769
cart: Cart!
2770+
2771+
"""
2772+
The CartTransform containing the function.
2773+
"""
2774+
cartTransform: CartTransform!
27132775
}
27142776

27152777
"""

checkout/rust/cart-transform/default/schema.graphql

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Attribute {
2424
}
2525

2626
"""
27-
Represents information about the buyer that is interacting with the cart.
27+
Represents information about the buyer that is interacting with the cart. Only set when the buyer is logged in.
2828
"""
2929
type BuyerIdentity {
3030
"""
@@ -72,6 +72,11 @@ type Cart {
7272
"""
7373
cost: CartCost!
7474

75+
"""
76+
A list of lines containing information about the items that can be delivered.
77+
"""
78+
deliverableLines: [DeliverableCartLine!]!
79+
7580
"""
7681
The delivery groups available for the cart based on the buyer's shipping address.
7782
"""
@@ -255,6 +260,26 @@ input CartOperation @oneOf {
255260
merge: MergeOperation
256261
}
257262

263+
"""
264+
A customization which applies cart transformations to the merchandise lines.
265+
"""
266+
type CartTransform implements HasMetafields {
267+
"""
268+
Returns a metafield by namespace and key that belongs to the resource.
269+
"""
270+
metafield(
271+
"""
272+
The key for the metafield.
273+
"""
274+
key: String!
275+
276+
"""
277+
The namespace for the metafield.
278+
"""
279+
namespace: String!
280+
): Metafield
281+
}
282+
258283
"""
259284
Represents information about a company which is also a customer of the shop.
260285
"""
@@ -2533,6 +2558,38 @@ Example values: `"29.99"`, `"29.999"`.
25332558
"""
25342559
scalar Decimal
25352560

2561+
"""
2562+
Represents information about the merchandise in the cart.
2563+
"""
2564+
type DeliverableCartLine {
2565+
"""
2566+
Retrieve a cart line attribute by key.
2567+
2568+
Cart line attributes are also known as line item properties in Liquid.
2569+
"""
2570+
attribute(
2571+
"""
2572+
The key of the attribute to retrieve.
2573+
"""
2574+
key: String
2575+
): Attribute
2576+
2577+
"""
2578+
The ID of the cart line.
2579+
"""
2580+
id: ID!
2581+
2582+
"""
2583+
The merchandise that the buyer intends to purchase.
2584+
"""
2585+
merchandise: Merchandise!
2586+
2587+
"""
2588+
The quantity of the merchandise that the customer intends to purchase.
2589+
"""
2590+
quantity: Int!
2591+
}
2592+
25362593
"""
25372594
List of different delivery method types.
25382595
"""
@@ -2710,6 +2767,11 @@ type Input {
27102767
The cart.
27112768
"""
27122769
cart: Cart!
2770+
2771+
"""
2772+
The CartTransform containing the function.
2773+
"""
2774+
cartTransform: CartTransform!
27132775
}
27142776

27152777
"""

sample-apps/bundles-cart-transform/extensions/cart-merge-expand/schema.graphql

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Attribute {
2424
}
2525

2626
"""
27-
Represents information about the buyer that is interacting with the cart.
27+
Represents information about the buyer that is interacting with the cart. Only set when the buyer is logged in.
2828
"""
2929
type BuyerIdentity {
3030
"""
@@ -72,6 +72,11 @@ type Cart {
7272
"""
7373
cost: CartCost!
7474

75+
"""
76+
A list of lines containing information about the items that can be delivered.
77+
"""
78+
deliverableLines: [DeliverableCartLine!]!
79+
7580
"""
7681
The delivery groups available for the cart based on the buyer's shipping address.
7782
"""
@@ -255,6 +260,26 @@ input CartOperation @oneOf {
255260
merge: MergeOperation
256261
}
257262

263+
"""
264+
A customization which applies cart transformations to the merchandise lines.
265+
"""
266+
type CartTransform implements HasMetafields {
267+
"""
268+
Returns a metafield by namespace and key that belongs to the resource.
269+
"""
270+
metafield(
271+
"""
272+
The key for the metafield.
273+
"""
274+
key: String!
275+
276+
"""
277+
The namespace for the metafield.
278+
"""
279+
namespace: String!
280+
): Metafield
281+
}
282+
258283
"""
259284
Represents information about a company which is also a customer of the shop.
260285
"""
@@ -2533,6 +2558,38 @@ Example values: `"29.99"`, `"29.999"`.
25332558
"""
25342559
scalar Decimal
25352560

2561+
"""
2562+
Represents information about the merchandise in the cart.
2563+
"""
2564+
type DeliverableCartLine {
2565+
"""
2566+
Retrieve a cart line attribute by key.
2567+
2568+
Cart line attributes are also known as line item properties in Liquid.
2569+
"""
2570+
attribute(
2571+
"""
2572+
The key of the attribute to retrieve.
2573+
"""
2574+
key: String
2575+
): Attribute
2576+
2577+
"""
2578+
The ID of the cart line.
2579+
"""
2580+
id: ID!
2581+
2582+
"""
2583+
The merchandise that the buyer intends to purchase.
2584+
"""
2585+
merchandise: Merchandise!
2586+
2587+
"""
2588+
The quantity of the merchandise that the customer intends to purchase.
2589+
"""
2590+
quantity: Int!
2591+
}
2592+
25362593
"""
25372594
List of different delivery method types.
25382595
"""
@@ -2710,6 +2767,11 @@ type Input {
27102767
The cart.
27112768
"""
27122769
cart: Cart!
2770+
2771+
"""
2772+
The CartTransform containing the function.
2773+
"""
2774+
cartTransform: CartTransform!
27132775
}
27142776

27152777
"""

0 commit comments

Comments
 (0)