Skip to content

Instantly share code, notes, and snippets.

@hwillson
Created February 16, 2019 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hwillson/01ab7f9bc2a18e6d842d60705756382c to your computer and use it in GitHub Desktop.
Save hwillson/01ab7f9bc2a18e6d842d60705756382c to your computer and use it in GitHub Desktop.
Apollo Client - 2.5.0 Announcement Post - Code Splitting 1
import React from 'react';
import { render } from 'react-dom';
import { BrowserRouter as Router } from 'react-router-dom';
import { ApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { HttpLink } from 'apollo-link-http';
import { ApolloProvider } from 'react-apollo';
import App from './components/App';
const client = new ApolloClient({
cache: new InMemoryCache(),
link: new HttpLink({
uri: 'http://localhost:4000/graphql',
}),
});
render(
<ApolloProvider client={client}>
<Router>
<App />
</Router>
</ApolloProvider>,
document.getElementById('root'),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment