From 89492d75120a0a3239b959ec2af56917bfb71790 Mon Sep 17 00:00:00 2001 From: dennis3001 Date: Fri, 27 Nov 2020 15:05:35 +0100 Subject: [PATCH] stop retrying on Unauthorized --- packages/aws-appsync/src/link/retry-link.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/aws-appsync/src/link/retry-link.ts b/packages/aws-appsync/src/link/retry-link.ts index 0468468c..ff9a9273 100644 --- a/packages/aws-appsync/src/link/retry-link.ts +++ b/packages/aws-appsync/src/link/retry-link.ts @@ -33,6 +33,10 @@ export const createRetryLink = (origLink: ApolloLink) => { if (permanent) { return false; } + + if (error.errors && error.errors.length && error.errors.find(e => e.message && e.message.toLowerCase().includes('unauthorized'))) { + return false; + } if (error.statusCode >= 400 && error.statusCode < 500) { return false;