From 9b3488c6a03cc09a647f43f6a8b36d96e97e5bb8 Mon Sep 17 00:00:00 2001 From: Erwin Otten Date: Tue, 5 Apr 2022 12:25:57 +0200 Subject: [PATCH] Fix/non blocking error (#1381) * fix: non blocking error handling * fix: Add changeset --- .changeset/witty-dolls-bow.md | 5 +++++ .../components/ProductListItems/getFilterTypes.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/witty-dolls-bow.md diff --git a/.changeset/witty-dolls-bow.md b/.changeset/witty-dolls-bow.md new file mode 100644 index 0000000000..c36135458e --- /dev/null +++ b/.changeset/witty-dolls-bow.md @@ -0,0 +1,5 @@ +--- +'@graphcommerce/magento-product': patch +--- + +Non blocking error handling diff --git a/packages/magento-product/components/ProductListItems/getFilterTypes.ts b/packages/magento-product/components/ProductListItems/getFilterTypes.ts index 3e56012636..205b1ddd04 100644 --- a/packages/magento-product/components/ProductListItems/getFilterTypes.ts +++ b/packages/magento-product/components/ProductListItems/getFilterTypes.ts @@ -1,4 +1,4 @@ -import { gql, ApolloClient, NormalizedCacheObject , Exact } from '@graphcommerce/graphql' +import { gql, ApolloClient, NormalizedCacheObject, Exact } from '@graphcommerce/graphql' import { AllFilterInputTypes, FilterTypes } from './filterTypes' const allFilterInputTypes: AllFilterInputTypes[] = [ @@ -42,7 +42,7 @@ export async function getFilterTypes( ;(await filterInputTypes).data?.__type.inputFields.forEach(({ name, type }) => { if (!allFilterInputTypes.includes(type.name)) - throw new Error(`filter ${name} with FilterTypeInput ${type.name} not implemented`) + console.warn(`filter ${name} with FilterTypeInput ${type.name} not implemented`) typeMap[name] = type.name })