1npm install @apollo/client graphql
2
3import React from 'react';
4import { AppRegistry } from 'react-native';
5import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
6
7// Initialize Apollo Client
8const client = new ApolloClient({
9 uri: 'localhost:4000/graphql',
10 cache: new InMemoryCache()
11});
12
13const App = () => (
14 <ApolloProvider client={client}>
15 <MyRootComponent />
16 </ApolloProvider>
17);
18
19AppRegistry.registerComponent('MyApplication', () => App);