24 lines
542 B
TypeScript
24 lines
542 B
TypeScript
import { IResolverObject } from 'graphql-tools';
|
|
|
|
export const ContactInformation: IResolverObject = {
|
|
// (parent, args, ctx, info)
|
|
async address({ addressId }, args, { dataSources }) {
|
|
return dataSources.orderApi.getAddress(addressId);
|
|
},
|
|
};
|
|
|
|
async function getOrders(_, __, { dataSources }) {
|
|
return dataSources.orderApi.getOrders();
|
|
}
|
|
|
|
async function getOrder(_, { id }, { dataSources }) {
|
|
return dataSources.orderApi.getOrder(id);
|
|
}
|
|
|
|
const orders = {
|
|
orders: getOrders,
|
|
order: () => getOrder,
|
|
};
|
|
|
|
export default orders;
|