Skip to content

Instantly share code, notes, and snippets.

@mjstelly
Last active March 4, 2019 13:24
Show Gist options
  • Save mjstelly/338b2c397344ddb98916ede7c8e25087 to your computer and use it in GitHub Desktop.
Save mjstelly/338b2c397344ddb98916ede7c8e25087 to your computer and use it in GitHub Desktop.
Apollo Boost - My react native app.js
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