You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moritz Roessler edited this page Apr 17, 2023
·
1 revision
Apollo Provider
In order to implement the component examples from the examples pages, you need to wrap your application in an in an <ApolloProvider client={client} />. React Server will use the provided client.
In my-frontend/src/App.tsx wrap your entire application in the provider.
import{localClient}from'./lib/client';functionApp(){return(<divclassName="App"><ApolloProviderclient={process.env.NODE_ENV==='production' ? client : localClient}>{/* Your code here */}</ApolloProvider></div>);}
Note: You can still override the provided client if you pass one in the options