Skip to content

Instantly share code, notes, and snippets.

@kimobrian
Last active February 16, 2018 13:12
Show Gist options
  • Save kimobrian/a11adde388f833bfaa92e6a0d542f5b3 to your computer and use it in GitHub Desktop.
Save kimobrian/a11adde388f833bfaa92e6a0d542f5b3 to your computer and use it in GitHub Desktop.
A gist describing different tools in the GraphQL ecosystem: react-apollo, apollo-client
import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http'; // HttpLink replaces createNetworkInterface

// Create client that connects to the server
const client = new ApolloClient({
  link: HttpLink({ uri: /* server URL */}),
})
import { ApolloProvider } from 'react-apollo';

ReactDOM.render((
  <ApolloProvider client={client}>
    <Router history={browserHistory}>
      <Route path='/' component={Pokedex} />
    </Router>
  </ApolloProvider>
  ),
  document.getElementById('root')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment