Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

fix(fastify-template): switching to apollo-server-fastify #2256

Closed
wants to merge 2 commits into from
Closed

fix(fastify-template): switching to apollo-server-fastify #2256

wants to merge 2 commits into from

Conversation

RinkiyaKeDad
Copy link
Contributor

Fixes #2174

Types of changes

What types of changes does your code introduce to Graphback?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Other (please specify)

Checklist

  • I have read the CONTRIBUTING document.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Verification

Subscriptions are now working in the Fastify template.
subsWorking

Further comments

There was a slight problem while fixing this. The latest stable release of apollo-server-fastify is 2.19.1 which has not been configured to work properly with Fastify v3. An early alpha does exist but I am not sure if that would work and what separate issues that might bring along with it. Since I shifted to Fastify v2 I also had to shift to v3 of fastify-cors since v4 only supports Fastify v3.

Will update the README to reflect that we're using apollo-server-fastify instead of mercurius once we can confirm that the issue is now fixed.

@wtrocki
Copy link
Contributor

wtrocki commented Jan 12, 2021

In my queue. Will take look into this!

@RinkiyaKeDad
Copy link
Contributor Author

@wtrocki - please review this one too

@wtrocki
Copy link
Contributor

wtrocki commented Feb 15, 2021

Sure. Needs rebase

@wtrocki
Copy link
Contributor

wtrocki commented Feb 16, 2021

Let's merge #2269 then we will rebase this one and verify.

@wtrocki
Copy link
Contributor

wtrocki commented Feb 16, 2021

Using Apollo-server fastify which is not well maintained will be against what we want to do here.
Apollo Server Fastify is not as fast and feature-rich as mercurious so not sure if we really want to merge this change. Obviously Apollo-server fastify will work as subscription resolvers are in apollo format. Mercurious use graphql-js format and that is (probable) reason they never worked.

If we think about it sometimes we get stuck with resolving problems and then we use something else.
In Graphback we follow different ethos. First, we want to know why things do not work and then make the decision to move to something else.

We wanted to use mercurous. They have subscription examples in their project.
Do we know why subscriptions do not work with mercurious?

@RinkiyaKeDad
Copy link
Contributor Author

Will get back to you on this

@wtrocki
Copy link
Contributor

wtrocki commented May 6, 2021

This is open for a long time. I think we can accept apollo-fastify as exception. Small rebase needed.

@RinkiyaKeDad
Copy link
Contributor Author

Resolved the merge conflict.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subscriptions not working in GraphiQL Playground with Fastify
2 participants