From de4139c5c05af2dc912bc291a75bdeb30e9affe8 Mon Sep 17 00:00:00 2001 From: David Thyresson Date: Mon, 16 Oct 2023 09:05:17 -0400 Subject: [PATCH] chore: Restore name of terminating Apollo link to httpLink (#9205) --- packages/web/src/apollo/index.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/web/src/apollo/index.tsx b/packages/web/src/apollo/index.tsx index 25b7c0d574b0..915dfa3fa1ec 100644 --- a/packages/web/src/apollo/index.tsx +++ b/packages/web/src/apollo/index.tsx @@ -54,7 +54,7 @@ export type RedwoodApolloLinkName = | 'withToken' | 'authMiddleware' | 'updateDataApolloLink' - | 'terminatingLink' + | 'httpLink' export type RedwoodApolloLink< Name extends RedwoodApolloLinkName, @@ -68,10 +68,7 @@ export type RedwoodApolloLinks = [ RedwoodApolloLink<'withToken'>, RedwoodApolloLink<'authMiddleware'>, RedwoodApolloLink<'updateDataApolloLink'>, - RedwoodApolloLink< - 'terminatingLink', - apolloClient.ApolloLink | apolloClient.HttpLink - > + RedwoodApolloLink<'httpLink', apolloClient.ApolloLink | apolloClient.HttpLink> ] export type RedwoodApolloLinkFactory = ( @@ -208,7 +205,7 @@ const ApolloProviderWithFetchConfig: React.FunctionComponent<{ // Our terminating link needs to be smart enough to handle subscriptions, and if the GraphQL query // is subscription it needs to use the SSELink (server sent events link). - const terminatingLink = apolloClient.split( + const httpOrSSELink = apolloClient.split( ({ query }) => { const definition = getMainDefinition(query) @@ -231,7 +228,7 @@ const ApolloProviderWithFetchConfig: React.FunctionComponent<{ { name: 'withToken', link: withToken }, { name: 'authMiddleware', link: authMiddleware }, { name: 'updateDataApolloLink', link: updateDataApolloLink }, - { name: 'terminatingLink', link: terminatingLink }, + { name: 'httpLink', link: httpOrSSELink }, ] let link = redwoodApolloLink