Add keyword mutation for product (#19)

This commit is contained in:
Niklas Fondberg
2021-09-03 09:51:49 +02:00
committed by GitHub
parent cb4a7c40b7
commit 596d21dce8
3 changed files with 33 additions and 9 deletions
+7
View File
@@ -94,4 +94,11 @@ export const productMutationTypeDefs = {
);
return (<ProductAPI>dataSources.productApi).getProduct(productId);
},
async productKeywords(_, { productId, keywordIds }, { dataSources }) {
await (<KeywordAPI>dataSources.keywordApi).setProductKeywords(
productId,
keywordIds,
);
return (<ProductAPI>dataSources.productApi).getProduct(productId);
},
};