Shopify Functions
app.defineFunction() configures the OpenShop management UI and GraphQL mutations for Shopify Function instances. It does not define the WASM function implementation.
export const volumeDiscount = app.defineFunction({ type: 'discount', handle: 'volume-discount', modes: ['automatic', 'code'], owner: { title: (config) => `Volume discount ${config.threshold}`, combinesWith: { productDiscounts: true }, startsAt: true, endsAt: true, }, config: { threshold: { type: 'number', label: 'Minimum quantity' }, percentage: { type: 'number', label: 'Percentage off' }, },})Supported function types
Section titled “Supported function types”discountcart-transformdelivery-customizationpayment-customizationcheckout-validationfulfillment-constraints
Some Shopify Function types do not support update mutations. OpenShop surfaces this in the admin UI and expects delete-and-recreate for those types.