Add keywords and product types

This commit is contained in:
Niklas Fondberg
2021-07-07 16:16:58 +02:00
parent 512ebf89f5
commit 267bc4f1c9
11 changed files with 262 additions and 53 deletions
+5
View File
@@ -5,6 +5,8 @@ import { ProductAPI } from '../datasources/product-api';
import { Product } from '../types/product-types';
import { CategoryAPI } from '../datasources/category-api';
import { Category } from '../types/category-types';
import { KeywordAPI } from '../datasources/keyword-api';
import { Keyword } from '../types/keyword-types';
const ProductBlacklist: IResolverObject = {
async market(parent, _args, { dataSources }) {
@@ -20,6 +22,9 @@ const Product: IResolverObject = {
async designer({ designerId }, args, { dataSources }) {
return dataSources.designerApi.getDesignerById(designerId);
},
async keywords({ id }, _args, { dataSources }): Promise<Array<Keyword>> {
return (<KeywordAPI>dataSources.keywordApi).getProductKeywords(id);
},
async api1json({ id }, _args, { dataSources }): Promise<JSON> {
return dataSources.api1.getProduct(id);
},