Skip to content

Yarn 2.0 support #2923

Open
Open
@snikch

Description

@snikch

Describe the bug

GraphQL Mesh does not appear to have correctly defined dependencies in its packages, and as such will not run out of the box with Yarn 2.0+. Some of the issues come from upstream packages, but some are also @graphql-mesh packages.

To Reproduce
Steps to reproduce the behavior:

> yarn init
yarn init v1.22.11
question name (mesh2):
question version (1.0.0):
question description:
question entry point (index.js):
question repository url:
question author:
question license (MIT):
question private:
success Saved package.json
✨  Done in 2.56s.

> yarn set version berry
Resolving berry to a url...
Downloading https://github.com/yarnpkg/berry/raw/master/packages/berry-cli/bin/berry.js...
Saving it into /Users/mal/Code/src/gitlab.inmusicbrands.com/cloud/mesh2/.yarn/releases/yarn-berry.cjs...
Updating /Users/mal/Code/src/gitlab.inmusicbrands.com/cloud/mesh2/.yarnrc.yml...
Done!

> yarn add @graphql-mesh/cli
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @graphql-mesh/cli@npm:0.41.0 [b4b5a] doesn't provide graphql-tag (p5841b), requested by @graphql-codegen/typescript-generic-sdk
➤ YN0002: │ mesh2@workspace:. doesn't provide graphql (p19ff9), requested by @graphql-mesh/cli
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 7s 805ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ yargs-parser@npm:18.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs-parser@npm:20.2.9 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:15.4.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:17.2.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yocto-queue@npm:0.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 3s 489ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0s 411ms
➤ YN0000: Done with warnings in 11s 785ms
yarn add @graphql-mesh/cli  10.25s user 2.24s system 86% cpu 14.507 total

> yarn run mesh dev
/Users/mal/Code/src/gitlab.inmusicbrands.com/cloud/mesh2/.pnp.cjs:14675
    throw firstError;
    ^

Error: @graphql-tools/utils tried to access graphql (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.

Required package: graphql
Required by: @graphql-tools/utils@virtual:d76146c6a6cf1026eae6a659b42ea73a5ac6ef5c4ab43e1d1c3836adaf2d4c8c39297d580f36f1574a206fb01b2810a246ddde8ccdde86f74d9a1c9c0ae22e9c#npm:8.2.5 (via /Users/mal/Code/src/gitlab.inmusicbrands.com/cloud/mesh2/.yarn/__virtual__/@graphql-tools-utils-virtual-5edbf7bf35/0/cache/@graphql-tools-utils-npm-8.2.5-2667229970-421147485c.zip/node_modules/@graphql-tools/utils/)
Ancestor breaking the chain: mesh2@workspace:.


Require stack:
- /Users/mal/Code/src/gitlab.inmusicbrands.com/cloud/mesh2/.yarn/__virtual__/@graphql-tools-utils-virtual-5edbf7bf35/0/cache/@graphql-tools-utils-npm-8.2.5-2667229970-421147485c.zip/node_modules/@graphql-tools/utils/index.js
- /Users/mal/Code/src/gitlab.inmusicbrands.com/cloud/mesh2/.yarn/__virtual__/@graphql-mesh-utils-virtual-2a9b48df9a/0/cache/@graphql-mesh-utils-npm-0.17.2-3892945af8-bdc94b382e.zip/node_modules/@graphql-mesh/utils/index.js
- /Users/mal/Code/src/gitlab.inmusicbrands.com/cloud/mesh2/.yarn/__virtual__/@graphql-mesh-cli-virtual-d76146c6a6/0/cache/@graphql-mesh-cli-npm-0.41.0-e52b17b839-1913166ec6.zip/node_modules/@graphql-mesh/cli/bin.js
    at Function.external_module_.Module._resolveFilename (/Users/mal/Code/src/gitlab.inmusicbrands.com/cloud/mesh2/.pnp.cjs:14674:55)
    at Function.external_module_.Module._load (/Users/mal/Code/src/gitlab.inmusicbrands.com/cloud/mesh2/.pnp.cjs:14473:48)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/Users/mal/Code/src/gitlab.inmusicbrands.com/cloud/mesh2/.yarn/__virtual__/@graphql-tools-utils-virtual-5edbf7bf35/0/cache/@graphql-tools-utils-npm-8.2.5-2667229970-421147485c.zip/node_modules/@graphql-tools/utils/index.js:5:17)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.external_module_.Module._load (/Users/mal/Code/src/gitlab.inmusicbrands.com/cloud/mesh2/.pnp.cjs:14523:14)
    at Module.require (node:internal/modules/cjs/loader:1005:19)

This can be manually worked around by adding the following to .yarnrc.yml.

packageExtensions:
  "@graphql-tools/[email protected]":
    dependencies:
      graphql: "*"
  "@graphql-mesh/[email protected]":
    dependencies:
      "@graphql-mesh/types": "*"
      "@graphql-mesh/cache-inmemory-lru": "*"
  "@graphql-mesh/[email protected]":
    dependencies:
      graphql: "*"

Environment:

  • OS: Mac
  • @graphql-mesh/cli: 0.41.0
  • NodeJS: v16.8.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/0-issue-prerequisitesNeeds more information before we can start working on it

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions