Added designers
This commit is contained in:
@@ -1,24 +1,33 @@
|
||||
// (parent, args, ctx, info)
|
||||
import { IResolverObject } from 'graphql-tools';
|
||||
import { OrderAPI } from '../datasources/order-api';
|
||||
import { ProductAPI } from '../datasources/product-api';
|
||||
|
||||
const ProductBlacklist: IResolverObject = {
|
||||
async market(parent, args, { dataSources }) {
|
||||
return dataSources.orderApi.getMarketById(parent.marketId);
|
||||
return (<OrderAPI>dataSources.orderApi).getMarketById(parent.marketId);
|
||||
},
|
||||
};
|
||||
|
||||
const Product: IResolverObject = {
|
||||
async categories({ id }, args, { dataSources }) {
|
||||
return dataSources.productApi.getCategories(id);
|
||||
return (<ProductAPI>dataSources.productApi).getCategories(id);
|
||||
},
|
||||
async designer({ designerId }, args, { dataSources }) {
|
||||
return dataSources.designerApi.getDesignerById(designerId);
|
||||
},
|
||||
};
|
||||
|
||||
async function getProducts(_, { limit, visible, browsable }, { dataSources }) {
|
||||
return dataSources.productApi.getProducts(limit, visible, browsable);
|
||||
return (<ProductAPI>dataSources.productApi).getProducts(
|
||||
limit,
|
||||
visible,
|
||||
browsable,
|
||||
);
|
||||
}
|
||||
|
||||
async function getProduct(_, { id }, { dataSources }) {
|
||||
return dataSources.productApi.getProduct(id);
|
||||
return (<ProductAPI>dataSources.productApi).getProduct(id);
|
||||
}
|
||||
|
||||
export const productTypeDefs = {
|
||||
|
||||
Reference in New Issue
Block a user