enisdenjo / graphql-yoga-nestjs

Nest GraphQL GraphQL Yoga driver
https://the-guild.dev/graphql/yoga-server/docs/integrations/integration-with-nestjs
25 stars 11 forks source link

fix: Make Fastify platform work #79

Closed yusufkandemir closed 1 year ago

yusufkandemir commented 1 year ago

Discovered thanks to #78

See https://the-guild.dev/graphql/yoga-server/docs/integrations/integration-with-fastify#example https://www.fastify.io/docs/latest/Reference/Routes/#async-await

smolinari commented 1 year ago

@yusufkandemir - Hey Yusuf. Fancy meeting you here! :grin:

Is this why, when I tried to migrate (my Fastify/ NestJS app) to Yoga last week, I wasn't getting anything back from the API? Shouldn't there be some sort of test for this? :smiley:

Scott

yusufkandemir commented 1 year ago

Hey Scott, same 😁

I was experiencing the same behavior, so most probably yes. I tried this fix and it worked fine. Related documentation and examples make sense, so it seems it's the correct fix to apply here.

There are some tests in place, I even tried adding a GraphiQL-specific test, but interestingly, they passed with and without the fix. I tried upgrading Fastify in this repo to v4, but it didn't make a difference. So, the race condition might become obvious only in real environments such as in a browser where there is extra overhead.

smolinari commented 1 year ago

Welp. If this gets merged, I'll try again to migrate.

Scott

smolinari commented 1 year ago

@charlypoly - Any chance to get this merged and released soon?

Scott

enisdenjo commented 1 year ago

Hey there, thanks for PR-ing this! Can you please fix the linting issues? I'll merge then ASAP.

Urigo commented 1 year ago

thank you @yusufkandemir ! We would love to thank you publicly, if you can share your Twitter/LinkedIn profile (also in private if you prefer) ?

smolinari commented 1 year ago

Btw, this fixed my problem. I can now run Yoga instead of Mercurius with NestJS and Fastify. Awesome! Thanks everyone! :+1: :100: :tada:

Scott

yusufkandemir commented 1 year ago

@Urigo you are welcome, and thanks! https://www.linkedin.com/in/yusuf-kandemir/

Urigo commented 1 year ago

https://www.linkedin.com/posts/activity-7034515817975164929-p70k?utm_source=post_nba&utm_medium=member_desktop&utm_campaign=copy