0

I'm trying to generate my graphql file by running graphql-codegen --config codegen.yml and I'm getting this error:

    Error: Cannot use GraphQLInterfaceType "AbstractEntity" from another module or realm.

    Ensure that there is only one instance of "graphql" in the node_modules
    directory. If different versions of "graphql" are the dependencies of other
    relied on modules, use "resolutions" to ensure only one version is installed.

    https://yarnpkg.com/en/docs/selective-version-resolutions

    Duplicate "graphql" modules cannot be used at the same time since different
    versions may have different capabilities and behavior. The data from one
    version used in the function from another could produce confusing and
    spurious results.

I'm running my web and api server inside docker containers so I know there aren't any other graphql installations. Does anyone have any ideas as to why I'm getting this?

Brace Sproul
  • 593
  • 1
  • 5
  • 15
  • Hi, which version of `graphql` are you using? Do you have a monorepo setup with multiple packages that use `graphql`? – Charly Poly Nov 28 '22 at 10:19
  • @CharlyPoly running turbo repo as the mono repo, node 14, in my frontend: graphql-codegen/add: 3.2.1, graphql-codegen/cli: 1.21.5, graphql-codegen/introspection: 1.18.2, graphql-codegen/typescript: 1.22.3, graphql-codegen/typescript-operations: 1.18.2, graphql-codegen/typescript-react-apollo: 2.2.7, and in backend: graphql: 15.5.0, – Brace Sproul Nov 28 '22 at 20:53
  • There error your get reveals that many versions of `graphql` are present in your project. Could you run `yarn why graphql`? – Charly Poly Nov 30 '22 at 09:24

0 Answers0