Be more careful with default types (#34)

This commit is contained in:
Niklas Fondberg
2021-09-09 09:40:40 +02:00
committed by GitHub
parent 4eb04534f5
commit 692b530623
11 changed files with 130 additions and 41 deletions
-1
View File
@@ -30,7 +30,6 @@ export const keywordsMutationTypeDefs = {
name,
type,
);
console.log(id);
return (<KeywordAPI>dataSources.keywordApi).getKeywordById(id);
},
};
+8 -1
View File
@@ -10,6 +10,7 @@ import { KeywordAPI } from '../datasources/keyword-api';
import { Keyword } from '../types/keyword-types';
import { MarketLocaleAPI } from '../datasources/market-locale-api';
import { InteriorAPI } from '../datasources/interior-api';
import { InteriorsLambdaAPI } from '../datasources/interiors-lambda-api';
const ProductBlacklist = {
async market(parent, _args, { dataSources }) {
@@ -111,7 +112,13 @@ export const productMutationTypeDefs = {
productId,
groupIds,
);
return (<ProductAPI>dataSources.productApi).getProduct(productId);
const product = await (<ProductAPI>dataSources.productApi).getProduct(
productId,
);
await (<InteriorsLambdaAPI>(
dataSources.interiorsLambdaApi
)).generateNewInteriors(product);
return product;
},
async productKeywords(_, { productId, keywordIds }, { dataSources }) {
await (<KeywordAPI>dataSources.keywordApi).setProductKeywords(