Basically as the title says, I'm creating a React app in CodeSandbox and installing Apollo/Client as a dependency to link to my back end GraphQl. After I add it as a dependency, I try and import it to my index.js, but I get a "Type Error Cannot Read properties of undefined( reading 'field'). The error goes away when I remove the import.
import React from 'react';
import { render } from 'react-dom';
import {
ApolloClient,
InMemoryCache,
ApolloProvider,
useQuery,
gql
} from "@apollo/client";
const client = new ApolloClient({
uri: 'https://48p1r2roz4.sse.codesandbox.io',
cache: new InMemoryCache()
});
function App() {
return (
<div>
<h2>My first Apollo app </h2>
</div>
);
}
render(
<ApolloProvider client={client}>
<App />
</ApolloProvider>,
document.getElementById('root'),
);