Add product
This commit is contained in:
@@ -1,7 +1,25 @@
|
||||
// (parent, args, ctx, info)
|
||||
const products = {
|
||||
products: (_, { limit, visible, browsable }, { dataSources }) =>
|
||||
dataSources.productApi.getProducts(limit, visible, browsable),
|
||||
import { IResolverObject } from 'graphql-tools';
|
||||
|
||||
const ProductBlacklist: IResolverObject = {
|
||||
async market(parent, args, { dataSources }) {
|
||||
return dataSources.orderApi.getMarketById(parent.marketId);
|
||||
},
|
||||
};
|
||||
|
||||
export default products;
|
||||
async function getProducts(_, { limit, visible, browsable }, { dataSources }) {
|
||||
return dataSources.productApi.getProducts(limit, visible, browsable);
|
||||
}
|
||||
|
||||
async function getProduct(_, { id }, { dataSources }) {
|
||||
return dataSources.productApi.getProduct(id);
|
||||
}
|
||||
|
||||
export const productTypeDefs = {
|
||||
ProductBlacklist,
|
||||
};
|
||||
|
||||
export const productQueryTypeDefs = {
|
||||
products: getProducts,
|
||||
product: getProduct,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user