Im using graphql to create a discounCodeApp but got 415 error code.
so is there anyway to set headers content-type for this request
const {
discountCodeAppCreate: { codeAppDiscount, userErrors },
} = (await shopifyClient.client.graphql(query, {
codeAppDiscount: {
title: discount.title,
code: discount.code,
startsAt: discount.startsAt,
customerSelection: {
all: true,
},
metafields: [
{
namespace: "$app:order-discount",
key: "function-configuration",
type: "json",
value: JSON.stringify({
percentage: discount.value,
maximum: discount.maximum,
}),
},
],
functionId: functionDiscount.id,
},
})) as {
discountCodeAppCreate: {
codeAppDiscount: { discountId: string };
userErrors: { field: string[]; message: string }[];
};
};