Estoy tratando de crear un servidor con ApolloClient y GraphQL pero obtuve el siguiente error:
SyntaxError: no se encontró la exportación con nombre 'ApolloClient'. El módulo solicitado '@apollo/client' es un módulo CommonJS, que puede no admitir todas las exportaciones de módulos como exportaciones con nombre.
mi código se ve así:
import { ApolloClient, InMemoryCache, createHttpLink } from '@apollo/client' const httpLink = createHttpLink({ uri: 'http://localhost:4000/graphql', }) const createApolloClient = () => { return new ApolloClient({ link: httpLink, cache: new InMemoryCache(), }) } export default createApolloClientLo intenté
import pkg from '@apollo/client' const { ApolloClient, InMemoryCache, createHttpLink } = pkgpero no ayudó