Last active
March 4, 2019 13:24
-
-
Save mjstelly/338b2c397344ddb98916ede7c8e25087 to your computer and use it in GitHub Desktop.
Apollo Boost - My react native app.js
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, { Component } from 'react' | |
import AppNavigator from './AppNavigator' | |
import { ApolloProvider, graphql } from 'react-apollo' | |
import { ApolloClient, HttpLink, InMemoryCache } from 'apollo-boost' | |
const client = new ApolloClient({ | |
link: new HttpLink({ | |
uri: | |
'https://your-graphql-endpoint' | |
}), | |
cache: new InMemoryCache() | |
}) | |
export default class App extends Component { | |
render() { | |
return ( | |
<ApolloProvider client={client}> | |
<AppNavigator /> | |
</ApolloProvider> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment