Skip to content

Problem of package development using GraphQL #1358

@terion-name

Description

@terion-name

I develop a package that uses graphql. It has peerDeps:

"peerDependencies": {
    "@types/graphql": "~0.10.4 || ~0.11.0 || ~0.12.0 || ~0.13.0",
    "graphql": "~0.10.4 || ~0.11.0 || ~0.12.0 || ~0.13.0"
  }

Using standart package development flow, I make a repo of this package, link it with yarn link, then go to test project and add it via yarn link package/name.

And on printSchema in the package I get:

Error: Cannot use GraphQLObjectType "__Directive" 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.

resolutions in both packages don't work.

And I see no options to suppress this behavior.

I think that there should be such option, to suppress this check on such cases (maybe via env variable or something else), in other case I don't understand, how to develop and check packages locally

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