-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
27 lines (22 loc) · 824 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React from 'react';
import ReactDOM from 'react-dom';
import registerServiceWorker from './registerServiceWorker';
import { ApolloClient, InMemoryCache } from 'apollo-boost';
import { ApolloProvider } from 'react-apollo';
import { createHttpLink } from 'apollo-link-http';
import { createPersistedQueryLink } from 'apollo-link-persisted-queries';
import App from './components/App';
import './index.css';
const client = new ApolloClient({
link: createPersistedQueryLink({ useGETForHashedQueries: true }).concat(
createHttpLink({ uri: 'http://localhost:5000/graphql' })
),
cache: new InMemoryCache(),
});
const AppWithProvider = () => (
<ApolloProvider client={client}>
<App />
</ApolloProvider>
);
ReactDOM.render(<AppWithProvider />, document.getElementById('root'));
registerServiceWorker();