Skip to content
Merged
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
168 changes: 83 additions & 85 deletions discounts/javascript/discount/default/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,27 @@ type CartDeliveryOption {
title: String
}

"""
The cart.delivery-options.discounts.generate.fetch target result. Refer to
[network access](https://shopify.dev/apps/build/functions/input-output/network-access/graphql) for Shopify Functions.
"""
input CartDeliveryOptionsDiscountsGenerateFetchResult {
"""
The http request.
"""
request: HttpRequest
}

"""
The cart.delivery-options.discounts.generate.run target result.
"""
input CartDeliveryOptionsDiscountsGenerateRunResult {
"""
The list of operations to apply discounts to the delivery lines.
"""
operations: [DeliveryOperation!]!
}

"""
Represents information about the merchandise in the cart.
"""
Expand Down Expand Up @@ -332,25 +353,46 @@ input CartLineTarget {
quantity: Int
}

"""
The cart.lines.discounts.generate.fetch target result. Refer to [network access]
(https://shopify.dev/apps/build/functions/input-output/network-access/graphql) for Shopify Functions.
"""
input CartLinesDiscountsGenerateFetchResult {
"""
The http request.
"""
request: HttpRequest
}

"""
The cart.lines.discounts.generate.run target result.
"""
input CartLinesDiscountsGenerateRunResult {
"""
The list of operations to apply discounts to the cart.
"""
operations: [CartOperation!]!
}

"""
The operations that can be performed to apply discounts to the cart.
"""
input CartOperation @oneOf {
"""
A list of valid discount codes that correspond to external discounts. This can
only be used by Functions with network access.
An operation that selects which entered discount codes to accept. Use this to
validate discount codes from external systems.
"""
addDiscountCodeValidations: ValidDiscountCodes
enteredDiscountCodesAccept: EnteredDiscountCodesAcceptOperation

"""
A group of order discounts that share a selection strategy.
An operation that applies order discounts to a cart that share a selection strategy.
"""
addOrderDiscounts: OrderDiscounts
orderDiscountsAdd: OrderDiscountsAddOperation

"""
A group of product discounts that share a selection strategy.
An operation that applies product discounts to a cart that share a selection strategy.
"""
addProductDiscounts: ProductDiscounts
productDiscountsAdd: ProductDiscountsAddOperation
}

"""
Expand Down Expand Up @@ -2805,9 +2847,9 @@ enum DeliveryDiscountSelectionStrategy {
}

"""
A group of delivery discounts that share a selection strategy.
An operation that applies delivery discounts to a cart that share a selection strategy.
"""
input DeliveryDiscounts {
input DeliveryDiscountsAddOperation {
"""
The list of delivery discount candidates to be applied.
"""
Expand Down Expand Up @@ -2869,15 +2911,15 @@ The operations that can be performed to apply discounts to the delivery lines.
"""
input DeliveryOperation @oneOf {
"""
A group of delivery discounts that share a selection strategy.
An operation that applies delivery discounts to a cart that share a selection strategy.
"""
addDeliveryDiscounts: DeliveryDiscounts
deliveryDiscountsAdd: DeliveryDiscountsAddOperation

"""
A list of valid discount codes that correspond to external discounts. This can
only be used by Functions with network access.
An operation that selects which entered discount codes to accept. Use this to
validate discount codes from external systems.
"""
addDiscountCodeValidations: ValidDiscountCodes
enteredDiscountCodesAccept: EnteredDiscountCodesAcceptOperation
}

"""
Expand Down Expand Up @@ -2943,57 +2985,35 @@ enum DiscountClass {
}

"""
A fixed amount value.
"""
input FixedAmount {
"""
The fixed amount value of the discount, in the currency of the cart.

The amount must be greater than or equal to 0.
"""
amount: Decimal!
}

"""
The cart.fetch target result. Refer to [network access]
(https://shopify.dev/apps/build/functions/input-output/network-access/graphql) for Shopify Functions.
A discount code used by the buyer to add a discount to the cart.
"""
input FunctionCartFetchResult {
input DiscountCode {
"""
The http request.
The discount code.
"""
request: HttpRequest
code: String!
}

"""
The cart.run target result.
An operation that selects which entered discount codes to accept. Use this to validate discount codes from external systems.
"""
input FunctionCartRunResult {
input EnteredDiscountCodesAcceptOperation {
"""
The list of operations to apply discounts to the cart.
The list of discount codes to accept.
"""
operations: [CartOperation!]!
codes: [DiscountCode!]!
}

"""
The delivery.fetch target result. Refer to
[network access](https://shopify.dev/apps/build/functions/input-output/network-access/graphql) for Shopify Functions.
A fixed amount value.
"""
input FunctionDeliveryFetchResult {
"""
The http request.
input FixedAmount {
"""
request: HttpRequest
}
The fixed amount value of the discount, in the currency of the cart.

"""
The delivery.run target result.
"""
input FunctionDeliveryRunResult {
"""
The list of operations to apply discounts to the delivery lines.
The amount must be greater than or equal to 0.
"""
operations: [DeliveryOperation!]!
amount: Decimal!
}

"""
Expand Down Expand Up @@ -3070,7 +3090,7 @@ interface HasGates {
The handle of the gate configurations to search for.
"""
handle: Handle
): [GateSubject!]!
): [GateSubject!]! @deprecated(reason: "Gates API is being sunset and will be removed in a future version. Use `metafields` instead for gate configuration.")
}

"""
Expand Down Expand Up @@ -3216,9 +3236,9 @@ type HttpResponse {
headers: [HttpResponseHeader!]! @deprecated(reason: "Use `header` instead.")

"""
The HTTP response body parsed as JSON.
If the body is valid JSON, it will be parsed and returned as a JSON object.
If parsing fails, then raw body is returned as a string.
The HTTP response body parsed as JSON.
If the body is valid JSON, it will be parsed and returned as a JSON object.
If parsing fails, then raw body is returned as a string.
Use this field when you expect the response to be JSON, or when you're dealing
with mixed response types, meaning both JSON and non-JSON.
Using this field reduces function instruction consumption and ensures that the data is formatted in logs.
Expand Down Expand Up @@ -4552,7 +4572,7 @@ type MutationRoot {
"""
The result of the Function.
"""
result: FunctionDeliveryFetchResult!
result: CartDeliveryOptionsDiscountsGenerateFetchResult!
): Void!

"""
Expand All @@ -4562,7 +4582,7 @@ type MutationRoot {
"""
The result of the Function.
"""
result: FunctionDeliveryRunResult!
result: CartDeliveryOptionsDiscountsGenerateRunResult!
): Void!

"""
Expand All @@ -4572,7 +4592,7 @@ type MutationRoot {
"""
The result of the Function.
"""
result: FunctionCartFetchResult!
result: CartLinesDiscountsGenerateFetchResult!
): Void!

"""
Expand All @@ -4582,7 +4602,7 @@ type MutationRoot {
"""
The result of the Function.
"""
result: FunctionCartRunResult!
result: CartLinesDiscountsGenerateRunResult!
): Void!
}

Expand Down Expand Up @@ -4657,9 +4677,9 @@ enum OrderDiscountSelectionStrategy {
}

"""
A group of order discounts that share a selection strategy.
An operation that applies order discounts to a cart that share a selection strategy.
"""
input OrderDiscounts {
input OrderDiscountsAddOperation {
"""
The list of order discount candidates to be applied.
"""
Expand Down Expand Up @@ -4721,7 +4741,7 @@ type Product implements HasGates & HasMetafields {
The handle of the gate configurations to search for.
"""
handle: Handle
): [GateSubject!]!
): [GateSubject!]! @deprecated(reason: "Gates API is being sunset and will be removed in a future version. Use `metafields` instead for gate configuration.")

"""
A unique human-friendly string of the product's title.
Expand Down Expand Up @@ -4860,7 +4880,7 @@ A target of a product discount candidate, which determines which cart line(s) th
Multiple targets with the same type and ID are the same as a single target of that type and ID with their
quantities added together, or `null` if any of those targets have a quantity of `null`.

See the [Discounts API reference](https://shopify.dev/docs/api/functions/reference/product-discounts/graphql#functionrunresult) for examples.
See the [Discounts API reference](https://shopify.dev/docs/api/functions/reference/discount/graphql/functioncartrunresult) for examples.
"""
input ProductDiscountCandidateTarget @oneOf {
"""
Expand Down Expand Up @@ -4906,9 +4926,9 @@ enum ProductDiscountSelectionStrategy {
}

"""
A group of product discounts that share a selection strategy.
An operation that applies product discounts to a cart that share a selection strategy.
"""
input ProductDiscounts {
input ProductDiscountsAddOperation {
"""
The list of product discount candidates to be applied.
"""
Expand Down Expand Up @@ -5119,28 +5139,6 @@ For example, `"https://example.myshopify.com"` is a valid URL. It includes a sch
"""
scalar URL

"""
A discount code that corresponds to a valid external discount.
This can only be used by Functions with network access.
"""
input ValidDiscountCode {
"""
The discount code.
"""
code: String!
}

"""
A list of valid discount codes that correspond to external discounts. This can
only be used by Functions with network access.
"""
input ValidDiscountCodes {
"""
The list of valid discount codes.
"""
codes: [ValidDiscountCode!]!
}

"""
A void type that can be used to return a null value from a mutation.
"""
Expand Down