Skip to content

Schema download failing again with graphql 14.4.2 ("Cannot use GraphQLSchema "[object GraphQLSchema]" from another module or realm") #1384

@m1010j

Description

@m1010j

Intended outcome:

Schema download succeeds.

Actual outcome:

Schema download fails:

Error: Cannot use GraphQLSchema "[object GraphQLSchema]" 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.
    at instanceOf (/opt/app/node_modules/apollo/node_modules/graphql/jsutils/instanceOf.js:28:13)
    at isSchema (/opt/app/node_modules/apollo/node_modules/graphql/type/schema.js:34:34)
    at assertSchema (/opt/app/node_modules/apollo/node_modules/graphql/type/schema.js:38:4)
    at validateSchema (/opt/app/node_modules/apollo/node_modules/graphql/type/validate.js:44:28)
    at assertValidSchema (/opt/app/node_modules/apollo/node_modules/graphql/type/validate.js:68:16)
    at assertValidExecutionArguments (/opt/app/node_modules/apollo/node_modules/graphql/execution/execute.js:163:35)
    at executeImpl (/opt/app/node_modules/apollo/node_modules/graphql/execution/execute.js:84:3)
    at execute (/opt/app/node_modules/apollo/node_modules/graphql/execution/execute.js:62:63)
    at Object.introspectionFromSchema (/opt/app/node_modules/apollo/node_modules/graphql/utilities/introspectionFromSchema.js:31:37)
    at Task.task (/opt/app/node_modules/apollo/lib/commands/service/download.js:21:82)

How to reproduce the issue:

Run yarn apollo service:download schema.json --endpoint {endpoint_url}.

Versions

I'm on apollo 2.15.0. I got the same error on 2.12.3, as described here, but this PR temporarily fixed it. But now after upgrading from graphql 14.4.0 to 14.4.2, I'm getting the error again.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions