-
Notifications
You must be signed in to change notification settings - Fork 2
provider
Moritz Roessler edited this page Apr 17, 2023
·
1 revision
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';
function App() {
return (
<div className="App">
<ApolloProvider
client={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