-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
37 lines (30 loc) · 890 Bytes
/
Copy pathApp.js
File metadata and controls
37 lines (30 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from 'react';
import { ApolloProvider } from 'react-apollo'
import { ApolloClient, HttpLink, InMemoryCache } from 'apollo-client-preset'
import Hello from './components/hello'
import { StyleSheet, View } from 'react-native';
// const httpLink = new HttpLink({ uri: 'http://localhost:3000/graphql' })
const httpLink = new HttpLink({ uri: 'https://client-react.herokuapp.com/graphql' });
this.client = new ApolloClient({
link: httpLink,
cache: new InMemoryCache()
});
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
export default class App extends React.Component {
render() {
return (
<ApolloProvider client={client}>
<View style={styles.container}>
<Hello name="World!" />
</View>
</ApolloProvider>
);
}
}