From 4907298f7860c60f6ae009373b6bff473473a7bc Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Wed, 28 Apr 2021 21:27:55 +0100 Subject: [PATCH] Add apollo provider logic --- src/index.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 4987d79..6fdc4d3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,5 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client'; import { ThemeProvider } from 'styled-components'; import { BrowserRouter } from 'react-router-dom'; import { theme } from './themes'; @@ -7,14 +8,21 @@ import App from './App'; import GlobalStyles from './GlobalStyles'; import reportWebVitals from './reportWebVitals'; +const client = new ApolloClient({ + uri: process.env.REACT_APP_GRAPHQL_API, + cache: new InMemoryCache(), +}); + ReactDOM.render( - - - - - - + + + + + + + + , document.getElementById('root') );