Added categories to products

This commit is contained in:
Niklas Fondberg
2021-04-08 15:39:50 +02:00
parent f60a51a94b
commit d30432f4f4
4 changed files with 31 additions and 24 deletions
+7
View File
@@ -7,6 +7,12 @@ const ProductBlacklist: IResolverObject = {
},
};
const Product: IResolverObject = {
async categories({ id }, args, { dataSources }) {
return dataSources.productApi.getCategories(id);
},
};
async function getProducts(_, { limit, visible, browsable }, { dataSources }) {
return dataSources.productApi.getProducts(limit, visible, browsable);
}
@@ -17,6 +23,7 @@ async function getProduct(_, { id }, { dataSources }) {
export const productTypeDefs = {
ProductBlacklist,
Product,
};
export const productQueryTypeDefs = {