FoalTS / foal

Full-featured Node.js framework, with no complexity. 🚀 Simple and easy to use, TypeScript-based and well-documented.
https://foalts.org/
MIT License
1.88k stars 137 forks source link

Graphql package version conflict #1066

Closed milkstork-kevin closed 2 years ago

milkstork-kevin commented 2 years ago

Version of FoalTS: v1 as well as v2

I'm getting this error when I try to do an npm i:

npm ERR! While resolving: @foal/graphql@1.12.2
npm ERR! Found: graphql@15.8.0
npm ERR! node_modules/graphql
npm ERR!   graphql@"^15.5.1" from the root project
npm ERR!   peer graphql@"^0.13.0 || ^14.0.0 || ^15.0.0" from @graphql-inspector/core@2.9.0
npm ERR!   node_modules/@graphql-inspector/core
npm ERR!     dev @graphql-inspector/core@"^2.6.1" from the root project
npm ERR!   15 more (@graphql-tools/graphql-file-loader, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer graphql@"^14.3.0" from @foal/graphql@1.12.2
npm ERR! node_modules/@foal/graphql
npm ERR!   @foal/graphql@"^1.12.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: graphql@14.7.0
npm ERR! node_modules/graphql
npm ERR!   peer graphql@"^14.3.0" from @foal/graphql@1.12.2
npm ERR!   node_modules/@foal/graphql
npm ERR!     @foal/graphql@"^1.12.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

I've tracked this issue down to the fact that the type-graphql package depends on graphql@15 whereas @foal/graphql is still on 14. Is there any reason we couldn't bump @foal/graphql up to v15?

LoicPoullain commented 2 years ago

Thank you for you investigation.

@foal/graphql only specifies major versions of graphQL package because the interface of the functions used internally might break between two major versions.

Prior versions of type-graphql were working (ex: 0.17.5) with v14.

I just updated and tested the package so that it can work with v15 starting from v2.9. Until the new version is published, you can still use a prior version of TypeGraphQL to make it work 👍