mercurius-js / mercurius

Implement GraphQL servers and gateways with Fastify
https://mercurius.dev/
MIT License
2.33k stars 234 forks source link

Fastify Mercurius and TypeGraphQL #968

Closed CrispenGari closed 1 year ago

CrispenGari commented 1 year ago

type-graphql has a bug when working with mercurius because of different versions of graphql. Installing type-graphql by running the command:

yarn add type-graphql graphql

This installs type-graphql version: 1.1.* and graphql version 16.*.* of which type-graphql version 1 expects graphql to be of version 15.3.* and if you downgrade graphql then mercurius won't be happy with the version of graphql. I spent some time trying to figure out how to fix this because in the docs you don't mention that. I suggest that you mention the installation of type-graphql as follows

yarn add type-graphql@next graphql reflect-metadata
# or with npm
npm install --save type-graphql@next graphql reflect-metadata

With this both type-graphql and mercurius will be happy.

jonnydgreen commented 1 year ago

Thanks for the report and proposed solution, would you like to submit a PR to address this?

mcollina commented 1 year ago

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

CrispenGari commented 1 year ago

I would love to fix the docs and edit on the installation of type-graphql does that require unit tests??

mcollina commented 1 year ago

Oh no, sorry that's my canned template.