WIP
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// (parent, args, ctx, info)
|
||||
import { IResolverObject } from 'graphql-tools';
|
||||
import { Api2DataSource } from '../datasources/api2-datasource';
|
||||
import { OrderAPI } from '../datasources/order-api';
|
||||
import { ProductAPI } from '../datasources/product-api';
|
||||
|
||||
@@ -18,6 +19,17 @@ const Product: IResolverObject = {
|
||||
},
|
||||
};
|
||||
|
||||
const PrintProduct: IResolverObject = {
|
||||
async price({ id }, { market, width, height, sku }, { dataSources }) {
|
||||
return (<Api2DataSource>dataSources.api2).getPrice(
|
||||
market,
|
||||
width,
|
||||
height,
|
||||
sku,
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
async function getProducts(_, { limit, visible, browsable }, { dataSources }) {
|
||||
return (<ProductAPI>dataSources.productApi).getProducts(
|
||||
limit,
|
||||
@@ -33,6 +45,7 @@ async function getProduct(_, { id }, { dataSources }) {
|
||||
export const productTypeDefs = {
|
||||
ProductBlacklist,
|
||||
Product,
|
||||
PrintProduct,
|
||||
};
|
||||
|
||||
export const productQueryTypeDefs = {
|
||||
|
||||
Reference in New Issue
Block a user