Skip to content

Does not work with apollo client v4 #26

@jwatzman

Description

@jwatzman

Describe the bug

Apollo Client v4 was released very recently. My app is using this graphql package via a Vite resolve alias (mapping graphql to graphql-web-lite), and unfortunately the build fails once moving to Apollo Client v4:

✘ [ERROR] No matching export in "../node_modules/graphql-web-lite/index.mjs" for import "OperationTypeNode"

    ../node_modules/@apollo/client/core/QueryManager.js:2:22:
      2 │ import { BREAK, Kind, OperationTypeNode, visit } from "graphql";
        ╵                       ~~~~~~~~~~~~~~~~~

✘ [ERROR] No matching export in "../node_modules/graphql-web-lite/index.mjs" for import "OperationTypeNode"

    ../node_modules/@apollo/client/core/ApolloClient.js:1:9:
      1 │ import { OperationTypeNode } from "graphql";
        ╵          ~~~~~~~~~~~~~~~~~

If I manually edit node_modules/graphql-web-lite/index.mjs to re-export OperationTypeNode from @0no-co/graphql.web (alongside BREAK, GraphQLError, etc) -- then the build succeeds and everything seems to work fine.

Reproduction

See above

Package version

"@apollo/client": "^4.0.2",
"graphql-web-lite": "^16.6.0-4",

Validations

  • I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
  • Follow our Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions