GraphQL.js v16 support
Recently, v16 release of graphql-js has been published:
https://github.com/graphql/graphql-js/releases/tag/v16.0.0
It contains a lot of breaking changes, so TypeGraphQL needs to be upgraded in order to support it.
For now, please stick to the 15.x version as described in peer-depdencencies and what the runtime check says:
UnmetGraphQLPeerDependencyError: Looks like you use an incorrect version of the 'graphql' package: "16.0.0". Please ensure that you have installed a version that meets TypeGraphQL's requirement: "^15.3.0".
This thread will be updated with the investigation about that.
It won't happen soon, as all the other GraphQL ecosystem tools need to support v16 too.
Support for GQL v16:
TypeGraphQL dependencies:
✅ graphql-query-complexity ✅ graphql-subscriptions
TypeGraphQL devDependencies:
✅ @apollo/federation ✅ @apollo/gateway ✅ @graphql-modules/core (available via the graphql-modules package, I think) ✅ @graphql-modules/di (available via the graphql-modules package, I think) ➖ apollo-cache-control (DEPRECATED) ✅ apollo-server ✅ apollo-server-plugin-response-cache ❌ graphql-redis-subscriptions (https://github.com/davidyaha/graphql-redis-subscriptions/issues/503) ✅ graphql-tag
Others:
❌ graphql-parse-resolve-info (https://github.com/graphile/graphile-engine/issues/773) ✅ graphql-relay-js ✅ graphql-scalars ✅ graphql-upload
Am I missing anything?
Are there any alternate packages that can be used in stead of graphql-parse-resolve-info? They really seem to be dragging there feet with v16 support.
type-graphql is the last of my packages still not supporting v16.
The graphql-parse-resolve-info upgrade is blocked by https://github.com/graphql/graphql-js/issues/2719, but it's not a dependency of type-graphql anyway.
Hello, are there any plans for graphql-js v 16 support?
@MichalLytek would be nice to include this in version 1.2.0 or maybe in a major as 2.0.0.
I would be content with either of them, but I think there is at least one change that might be considered breaking by some people, so 2.0.0 would be ideal,
It's time to have support for GQL v16 it should be fine
The
graphql-parse-resolve-infoupgrade is blocked by graphql/graphql-js#2719, but it's not a dependency of type-graphql anyway.
I agree it's not a dependency but at least to my knowledge there aren't any other (good?) packages out there which are v16 compatible that will let us know which fields were requested by the client. If I have missed any then please do list them, it would be good to have an alternatives list. For that it's worth, the way I use graphql-parse-resolve-info is like so: https://github.com/favware/graphql-pokemon/blob/main/src/utils/getRequestedFields.ts and as a parameter decorator in my resolvers.
Of course Michal has the final say in whether he wants to support v16 regardless of graphql-parse-resolve-info but the GraphQL issue that is blocking it seems pretty stale to me.
@renaldodev It's not the time yet.
Tons of apollo deps yells about graphql-js version on npm install. You can only use --force and pray 😛
Many of use are not using Apollo, hence this is not an issue for some of us
Tons of apollo deps yells about graphql-js version on
npm install. You can only use--forceand pray 😛
@MichalLytek I'd like to track these, would you mind listing them?
Any updates?
This is the blocking issue, seems the groundwork is done https://github.com/graphile/graphile-engine/pull/764#issuecomment-1055726062
@sachaw how is that issue blocking this repo from adopting gql 16? Postgraphile has nothing to do with type-graphql
As far as I'm aware, this repo depends on: graphql-parse-resolve-info
Which is a part of the graphile-engine monorepo.
There has been no specific drive to get this module updated, but wider support for upgrading there entire framework with the aforementioned pr https://github.com/graphile/graphile-engine/pull/764
As far as I'm aware, this repo depends on:
graphql-parse-resolve-info
Why do you think that?
I haven't looked at the source, but is that now what you meant by your original comment? https://github.com/MichalLytek/type-graphql/issues/1100#issuecomment-991604585
I'd be happy if that weren't the case.
That was just a list of GraphQL libraries that TypeGraphQL developers might use. TypeGraphQL itself only depends on graphql-query-complexity and graphql-subscriptions, but there are also quite a few dev dependencies that I haven't yet listed. I might update my comment to include those later.
Personally, I do use graphql-parse-resolve-info, but not everyone does.
Apologies for the confusion.
I am suprised it takes this long. Work on https://github.com/MichalLytek/type-graphql/tree/v16 is very close to being production ready IMHO. Not sure why it was not finalized since Jan 18.
I was unable to run apollo federation examples because of apollo not supporting v16. Did they release a new version yet?
I will try to finish this v16 upgrade and the rest of v2.0 preparation when I have time (which I don't have currently 😞).
Apollo merged their support for v16 in November, which I think was released in the middle of December.
@MichalLytek I think we're a few who'd love to help you finish this, if allowed. Would you be able to provide us with some information on where you left everything at if we were to continue your work?
@bellstrand I'm talking about apollo federation: https://github.com/apollographql/federation/issues/1422
https://github.com/apollographql/federation/pull/1428 (16.2.0) https://github.com/apollographql/federation/pull/1443 (16.3.0)
I've updated my comment with the TypeGraphQL dev dependencies.
The graphql-modules stuff is unreleased, and there's no support for v16 in graphql-redis-subscriptions. I don't know which of these are blockers.
Are there any deps that don't support v16? (excluding ones required by examples).
I'd suggest decoupling examples from the monorepo so they can be updated as support becomes available and not have to wait for wider spread adoption than necessary.
@sachaw So you would release a new version which can't work with a half of the ecosystem and just wait for users complaining that examples are not working? 🤔
The way I understand it is he's suggesting we remove the federation example and it's support, so users could not complain about that. Users who need federation support would be stuck on major v1. Not great, but at least it would put the ball on the apollo team. Now everyone is stuck waiting for them.
I will just finish the pending work and release the RC version, so all the eagerly waiting can start using v16 version and the rest will wait for the rest of the ecosystem and a stable release.
The way I understand it is he's suggesting we remove the federation example and it's support, so users could not complain about that. Users who need federation support would be stuck on major v1. Not great, but at least it would put the ball on the apollo team. Now everyone is stuck waiting for them.
Federation already supports v16, it's only graphql-modules and graphql-redis-subscriptions that lack support.
Federation already supports v16, it's only
graphql-modulesandgraphql-redis-subscriptionsthat lack support.
Did I miss something...? I thought graphql-parse-resolve-info also didn't support v16 yet, but you didn't list it here.
Federation already supports v16, it's only
graphql-modulesandgraphql-redis-subscriptionsthat lack support.Did I miss something...? I thought
graphql-parse-resolve-infoalso didn't support v16 yet, but you didn't list it here.
I was referring to TypeGraphQL's dependencies. The graphql-parse-resolve-info library doesn't yet support v16, but it's also not a dependency of TypeGraphQL.