Issues importing from react-apollo and apollo-client


#1

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.

20

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.


#2

Hey @chrismeister,

I pinged internally about this. Either one of the other team members or myself will circle back once we have more information.

Cheers,

Adam


#3

Hey @chrismeister,
It looks like versions of apollo-client past 2.3.5 are trying to pull in graphql@0.14, which doesn’t exist.
https://snack.expo.io/@thetc/apollo-imports has the react-apollo and apollo-client imports resolving.


#4

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.