We have an app that works perfectly in development and on dev stores. Once we installed it on a production store we could not update discounts like we can in development. The query is:
mutation UpdateDiscount($id: ID!, $discount: DiscountAutomaticAppInput!) {
discountUpdate: discountAutomaticAppUpdate(
id: $id
automaticAppDiscount: $discount
) {
userErrors {
code
message
field
}
}
}
variables:
{
discount: {
combinesWith: {
orderDiscounts: false,
productDiscounts: false,
shippingDiscounts: false
},
startsAt: '2023-08-15T16:58:55Z',
endsAt: null,
metafields: [ [Object] ],
title: 'GO - Local - edit'
},
id: 'gid://shopify/DiscountAutomaticApp/1415511310614'
}
Error:
GraphqlQueryError: invalid id
...
As this is not a “Discount not found” error or some other permissions error it seems to indicate that the id gid://shopify/DiscountAutomaticApp/1415511310614 is malformed in someway. But that format works in dev and based on all the documentation (and the sample discounts app) this is how these should be updated. Any ideas of what to do next?
Note: this is a custom app installed on a Shopify plus store so we do have access to the discounts api.