From ba8a537d24530473fff43aedd37751e122961f8d Mon Sep 17 00:00:00 2001 From: Jacob Spizziri Date: Fri, 5 Jul 2024 05:50:51 -0400 Subject: [PATCH] fix(ra-data-graphql): fix an issue with custom context being overwritten on queries fix #9973 --- packages/ra-data-graphql/src/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/ra-data-graphql/src/index.ts b/packages/ra-data-graphql/src/index.ts index c405a5bf82b..718535ab710 100644 --- a/packages/ra-data-graphql/src/index.ts +++ b/packages/ra-data-graphql/src/index.ts @@ -186,12 +186,16 @@ const buildGraphQLProvider = (options: Options): DataProvider => { ...query, fetchPolicy: 'network-only', ...getOptions(otherOptions.query, raFetchMethod, resource), - context: { + }; + + apolloQuery.context = merge( + { fetchOptions: { signal: params?.signal, }, }, - }; + apolloQuery.context, + ); return ( client