Compare commits

...
Author SHA1 Message Date
asiaznik d28dad2777 fix(proposals): error policy guard for proposal data provider 2023-08-17 17:41:16 +02:00
@@ -17,4 +17,17 @@ export const proposalsDataProvider = makeDataProvider<
never,
never,
ProposalsListQueryVariables
>({ query: ProposalsListDocument, getData });
>({
query: ProposalsListDocument,
getData,
/**
* Ignores errors for not found settlement asset for NewMarket proposals.
*
* It can happen that a NewMarket proposal is incomplete and does not contain
* `futureProduct` details. This guard protects against that.
*
* GQL Path: `terms.change.instrument.futureProduct.settlementAsset`
*/
errorPolicyGuard: (errors) =>
errors.every((e) => e.message.match(/failed to get asset for ID/)),
});