Hi,
I’m customizing order-details in the backend as this →
module.exports = {
resolver: {
Mutation: {
createOrderDetail: {
description: "create an order detail",
resolverOf: "application::order-details.order-details.create",
resolver: async (obj, options, { context }) => {
const data = context.request.body;
try {
const result = await strapi.api["order-details"].services[
"order-details"
].create(data);
return sanitizeEntity(result, {
model: strapi.models["order-details"],
});
but It won’t return expected data
– the mutation –
createOrderDetail(
input: {
data: {
orderQuantity: $orderQuantity
price: $price
salePrice: $salePrice
total: $total
published_at: $published_at
product: $product
productDiscount: $productDiscount
}
}
) {
orderDetail {
id
total
}
– returned result –
what is the correct way to handle the custom graphql mutation?
and
this won’t help, I tried both ways!
thank you.