Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/scripts/run-wasm-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,20 @@ esac

# Create a minimal app toml so Shopify CLI can discover the extensions
cat > shopify.app.toml << EOF
scopes = ""
client_id = "00000000000000000000000000000000"
name = "extensions-templates-ci"
application_url = "https://example.com"
embedded = true
extension_directories = ["${EXT_DIR_PATTERN}"]

[access_scopes]
scopes = ""

[auth]
redirect_urls = ["https://example.com/auth/callback"]

[webhooks]
api_version = "2026-04"
EOF

for dir in $EXT_DIR_PATTERN; do
Expand Down
243 changes: 243 additions & 0 deletions functions-cart-checkout-validation-js/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ type Cart implements HasMetafields {
key: String
): Attribute

"""
The billing address associated with the cart.
"""
billingAddress: MailingAddress

"""
Information about the customer that's interacting with the cart. It includes details such as the
customer's email and phone number, and the total amount of money the customer has spent in the store.
Expand Down Expand Up @@ -153,6 +158,11 @@ type Cart implements HasMetafields {
"""
deliveryGroups: [CartDeliveryGroup!]!

"""
The discounts that have been applied to the cart.
"""
discountApplications: [DiscountApplication!]!

"""
The items in a cart that the customer intends to purchase. A cart line is an entry in the
customer's cart that represents a single unit of a product variant. For example, if a customer adds two
Expand Down Expand Up @@ -194,6 +204,12 @@ type Cart implements HasMetafields {
namespace: String
): Metafield

"""
A purchase order number associated with the cart, often used for B2B transactions
to reference the buyer's internal purchase order.
"""
poNumber: String

"""
The physical location where a retail order is created or completed.
"""
Expand Down Expand Up @@ -251,6 +267,11 @@ type CartDeliveryGroup {
"""
deliveryOptions: [CartDeliveryOption!]!

"""
The discounts that have been applied to the delivery group.
"""
discountAllocations: [DiscountAllocation!]!

"""
The type of merchandise in the delivery group.
"""
Expand Down Expand Up @@ -359,6 +380,11 @@ type CartLine {
"""
cost: CartLineCost!

"""
The discounts that have been applied to the cart line.
"""
discountAllocations: [DiscountAllocation!]!

"""
The ID of the cart line.
"""
Expand Down Expand Up @@ -2916,6 +2942,127 @@ enum DeliveryMethod {
SHIPPING
}

"""
The discount application and the amount applied.
"""
type DiscountAllocation {
"""
The discount that was applied.
"""
discountApplication: DiscountApplication!

"""
The amount that was discounted.
"""
discountedAmount: MoneyV2!
}

"""
Discount that has been applied to the cart.
"""
type DiscountApplication implements HasMetafields {
"""
The method by which the discount's value is allocated to its entitled items.
"""
allocationMethod: DiscountApplicationAllocationMethod!

"""
A [custom field](https://shopify.dev/docs/apps/build/custom-data) that stores additional information
about a Shopify resource, such as products, orders, and
[many more](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldOwnerType).
Using [metafields with Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/metafields-for-input-queries)
enables you to customize the checkout experience.
"""
metafield(
"""
The unique identifier for the metafield within its namespace. A metafield is composed of a
namespace and a key, in the format `namespace.key`.
"""
key: String!

"""
A category that organizes a group of metafields. Namespaces are used to prevent naming conflicts
between different apps or different parts of the same app. If omitted, then the
[app-reserved namespace](https://shopify.dev/docs/apps/build/custom-data/ownership)
is used.
"""
namespace: String
): Metafield

"""
The lines on the cart targeted by the discount.
"""
targetSelection: DiscountApplicationTargetSelection!

"""
The type of line (i.e. line item or shipping line) on a cart that the discount is applicable towards.
"""
targetType: DiscountApplicationTarget!

"""
The total allocated amount of the discount across all items.
"""
totalAllocatedAmount: MoneyV2!

"""
The value of the discount.
"""
value: PricingValue!
}

"""
The method by which the discount's value is allocated onto its entitled lines.
"""
enum DiscountApplicationAllocationMethod {
"""
The value is spread across all entitled lines.
"""
ACROSS

"""
The value is applied onto every entitled line.
"""
EACH
}

"""
The type of line on an order that the discount is applicable towards.
"""
enum DiscountApplicationTarget {
"""
The discount applies onto line items.
"""
LINE_ITEM

"""
The discount applies onto shipping lines.
"""
SHIPPING_LINE
}

"""
The lines on the order to which the discount is applied, of the type defined by
the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of
`LINE_ITEM`, applies the discount on all line items that are entitled to the discount.
The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines.
"""
enum DiscountApplicationTargetSelection {
"""
The discount is allocated onto all the lines.
"""
ALL

"""
The discount is allocated onto only the lines that it's entitled for.
"""
ENTITLED

"""
The discount is allocated onto explicitly chosen lines.
"""
EXPLICIT
}

"""
A Function error for a path.
"""
Expand Down Expand Up @@ -4588,6 +4735,71 @@ type Metafield {
value: String!
}

"""
An instance of custom structured data defined by a MetaobjectDefinition.
"""
type Metaobject {
"""
The field for an object key, or null if the key has no field definition.
"""
field(
"""
The metaobject key to access.
"""
key: String!
): MetaobjectField

"""
The unique handle of the metaobject, useful as a custom ID.
"""
handle: String!

"""
The type of the metaobject.
"""
type: String!
}

"""
Provides a field definition and the data value assigned to it.
"""
type MetaobjectField {
"""
The assigned field value in JSON format.
"""
jsonValue: JSON

"""
The object key of this field.
"""
key: String!

"""
The type of the field.
"""
type: String!

"""
The assigned field value, always stored as a string regardless of the field type.
"""
value: String
}

"""
The input fields for retrieving a metaobject by handle.
"""
input MetaobjectHandleInput {
"""
The handle of the metaobject to retrieve.
"""
handle: String!

"""
The type of the metaobject. Must match an existing metaobject definition type.
"""
type: String!
}

"""
A precise monetary value and its associated currency. Combines a decimal amount
with a three-letter currency code to express prices, costs, and other financial
Expand Down Expand Up @@ -4674,6 +4886,21 @@ input Operation @oneOf {
validationAdd: ValidationAddOperation
}

"""
The percentage value of a discount.
"""
type PricingPercentageValue {
"""
The percentage value of the discount.
"""
value: Decimal!
}

"""
The price value for a discount application.
"""
union PricingValue = MoneyV2 | PricingPercentageValue

"""
The goods and services that merchants offer to customers. Products can include details such as
title, vendor, and custom data stored in [metafields](https://shopify.dev/docs/apps/build/custom-data).
Expand Down Expand Up @@ -5016,6 +5243,22 @@ type Shop implements HasMetafields {
"""
namespace: String
): Metafield

"""
Fetch a specific Metaobject by one of its unique identifiers. Only app-owned
metaobjects with the $app reserved prefix are accessible to functions.
"""
metaobject(
"""
The handle and type of the metaobject.
"""
handle: MetaobjectHandleInput

"""
The ID of the metaobject.
"""
id: ID
): Metaobject
}

"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api_version = "2026-01"
api_version = "2026-04"

[[extensions]]
name = "t:name"
Expand Down
Loading
Loading