I am trying to connect an app to a GraphQL-endpoint that I have set up on Amazon Web Services. I try to connect to the endpoint with Apollo Client starting off with an example code I have found on Apollos’ website:
import React from 'react';
import { AppRegistry } from 'react-native';
import { ApolloClient } from 'apollo-client';
import { ApolloProvider } from 'react-apollo';
// Create the client as outlined in the setup guide
const client = new ApolloClient();
const App = () => (
<ApolloProvider client={client}>
<MyRootComponent />
</ApolloProvider>
);
AppRegistry.registerComponent('MyApplication', () => App);
I can not get it to work since Expo Snack seems to have issues resolving apollo-client and react-apollo.
These errors occur whenever I try to add these libraries into package.json. Please note that I am completely new to Apollo Client, so I might be approaching this completely wrong.