Added categories to products
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user