From afcac8abc27b7c91bbfea26be732219cc3419a72 Mon Sep 17 00:00:00 2001 From: takahirohonda Date: Thu, 10 Oct 2024 22:19:52 +1100 Subject: [PATCH] cache sync test update --- apps/react-my-playground/src/index.tsx | 16 +++++++++------- .../Shop/TestPersistCacheApolloProvider.tsx | 1 - libs/utils-apollo-provider/src/index.ts | 1 + 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/apps/react-my-playground/src/index.tsx b/apps/react-my-playground/src/index.tsx index a61518b..b0daea2 100644 --- a/apps/react-my-playground/src/index.tsx +++ b/apps/react-my-playground/src/index.tsx @@ -23,13 +23,15 @@ const GRAPHQL_URI = import.meta.env.VITE_BIGCOMMERCE_GRAPHQL_URI const API_TOKEN = import.meta.env.VITE_API_TOKEN const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement) -root.render( - - - - - -) + +// This seems to create 2 apollo clients... +// root.render( +// +// +// +// +// +// ) root.render( diff --git a/apps/react-my-playground/src/pages/Shop/TestPersistCacheApolloProvider.tsx b/apps/react-my-playground/src/pages/Shop/TestPersistCacheApolloProvider.tsx index 0877e06..82eb25e 100644 --- a/apps/react-my-playground/src/pages/Shop/TestPersistCacheApolloProvider.tsx +++ b/apps/react-my-playground/src/pages/Shop/TestPersistCacheApolloProvider.tsx @@ -41,7 +41,6 @@ await persistCache({ }) // Continue setting up Apollo as usual. - const client = new ApolloClient({ link: from([authMiddleware, httpLink]), cache, diff --git a/libs/utils-apollo-provider/src/index.ts b/libs/utils-apollo-provider/src/index.ts index ee873b0..cb53d08 100644 --- a/libs/utils-apollo-provider/src/index.ts +++ b/libs/utils-apollo-provider/src/index.ts @@ -1,2 +1,3 @@ export * from './lib/ApolloProvider' export * from './lib/getCache' +export * from './lib/client'