Skip to content

Instantly share code, notes, and snippets.

@peggyrayzis
Created February 15, 2018 08:38
Show Gist options
  • Save peggyrayzis/2e1eacee7534dc807678ea0476c2dbf9 to your computer and use it in GitHub Desktop.
Save peggyrayzis/2e1eacee7534dc807678ea0476c2dbf9 to your computer and use it in GitHub Desktop.
import React from 'react';
import { render } from 'react-dom';
import ApolloClient from 'apollo-boost';
import { ApolloProvider } from 'react-apollo';
// Pass your GraphQL endpoint to uri
const client = new ApolloClient({
uri: 'https://nx9zvp49q7.lp.gql.zone/graphql'
});
const ApolloApp = () => (
<ApolloProvider client={client}>
<App />
</ApolloProvider>
);
render(ApolloApp, document.getElementById('root'));
@clarencenpy
Copy link

Hi there! I encountered an issue when running the above code: Functions are not valid as a React child
Fixed by using jsx component in render method. See gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment