Created
February 15, 2018 08:38
-
-
Save peggyrayzis/2e1eacee7534dc807678ea0476c2dbf9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.