Add graphql, apollo and setup client with uri

This commit is contained in:
2020-07-22 12:11:54 +02:00
parent 5a7f7b6f17
commit 6723cf6312
3 changed files with 96 additions and 2 deletions

View File

@@ -1,10 +1,19 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
import App from './components/App';
const client = new ApolloClient({
uri: 'https://spotify-graphql-server.herokuapp.com/graphql',
cache: new InMemoryCache(),
});
ReactDOM.render(
<React.StrictMode>
<App />
<ApolloProvider client={client}>
<App />
</ApolloProvider>
</React.StrictMode>,
document.getElementById('root'),
);