Add Query for productByPath (#117)

This commit is contained in:
Anders Gustafsson
2022-09-02 11:41:34 +02:00
committed by GitHub
parent f8f91247cf
commit eeb69fe5f0
4 changed files with 31 additions and 0 deletions
+9
View File
@@ -121,6 +121,14 @@ async function getProduct(_, { id }, { dataSources, auth }): Promise<Product> {
return (<ProductAPI>dataSources.productApi).getProduct(id);
}
async function getProductByPath(
_,
{ path },
{ dataSources },
): Promise<Product> {
return (<ProductAPI>dataSources.productApi).getProductByPath(path);
}
export const productTypeDefs = {
ProductBlacklist,
Product,
@@ -130,6 +138,7 @@ export const productTypeDefs = {
export const productQueryTypeDefs = {
products: getProductsResult,
product: getProduct,
productByPath: getProductByPath,
productsSearch: getProductsSearchResult,
};