Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to Apollo Server 3.x #100

Open
abdavid opened this issue Sep 9, 2021 · 13 comments
Open

Upgrading to Apollo Server 3.x #100

abdavid opened this issue Sep 9, 2021 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@abdavid
Copy link

abdavid commented Sep 9, 2021

Are there plans in motion to upgrade to latest Apollo server?

One of the main breaking changes revolve around subscriptions being refactored out. The migration guide outlines a possible way to continue to support subscriptions through ws with a workaround, but also states that client would have to be adjusted accordingly to make it work as I understand it.

I did a quick refactor in my fork of this project to see how much would break, and while the subscription support has been removed and some of the exports from apollo-core-server has changed, I managed to get tests to pass (while still removing references to subscriptions though!)

Thinking ahead would it be feasible to create a new major version of this module, documenting the breaking changes so that those that require the subscription support can stay in 2.x land, while those who do not get the bright and shiny 3.x, and start paving the way for 3.x that will get subscription support at some point?

Thoughts? @icebob

@icebob
Copy link
Member

icebob commented Sep 9, 2021

Yeah, I saw the migration guide and I saw it contains a lot of breaking changes. By the way, would be good to upgrade to the latest Apollo Server but would be good for any help. Could you open a PR with your changes?

@abdavid
Copy link
Author

abdavid commented Sep 10, 2021

I would love to help out. Ill create a PR with my changes later today, would probably need to clean it up since I mostly just focused on finding the pieces that broke and getting the tests to pass.

@HazemKhaled
Copy link

@abdavid how is the progress from your side? Create a draft if you need hands

@AndreMaz AndreMaz added the help wanted Extra attention is needed label Feb 28, 2022
@kicks321
Copy link

@icebob, Is there an update regarding this, or a projected timeline?

@icebob
Copy link
Member

icebob commented Apr 19, 2022

It's not in my timeline, but PR is accepted.

@veeramarni
Copy link

@icebob there is an existing PR, can it be merged?

@icebob
Copy link
Member

icebob commented Dec 15, 2022

Not yet, because the PR is not correct.

@jbool24
Copy link

jbool24 commented Aug 25, 2023

v3 officially deprecated

So, now should we skip v3 and try upgrading all deps to be compatible with v4?? @icebob How can I help??

@AndreMaz
Copy link
Member

AndreMaz commented Aug 25, 2023

@jbool24 please check this PR #118 (comment) It already contains some work re migration to v4

@abdavid
Copy link
Author

abdavid commented Aug 30, 2023

@AndreMaz @jbool24 Not really sure if it is worth migrating to v4, just a quick glance at #118 and checking out the code locally it is in a quite broken state. To me it looks like a large amount of work needed to migrate to v4 or v3 for that matter. For me it would look like we would need to create an ApolloServer plugin and use the addPlugin interface Apollo supplies. Also we need to consider that graphql-upload is not compatible with the project anymore considering that it is purely in mjs now.

I would argue that a re-implementation of graphql support for moleculer might be an easier approach. Also there has happened a lot with graphql. Like I mentioned before, adopting graphql yoga from The Guild could also improve some performance aspects while also improving DX.

Yoga repo: https://github.com/dotansimha/graphql-yoga
Yoga file upload: https://the-guild.dev/graphql/yoga-server/docs/features/file-uploads

@shawnmcknight
Copy link
Member

I've also created a package which eliminates apollo server entirely in favor of graphql-tools. It needs some polish still but it's working. I don't have a timeline for doing the additional work, but I think this path is better than relying on Apollo server. https://github.com/shawnmcknight/moleculer-graphql

@abdavid
Copy link
Author

abdavid commented Aug 30, 2023

Thanks @shawnmcknight ! Ill test out replacing our current apollo variant with @shawnmcknight/moleculer-graphql 👍 as for this repo here, if someone really needs apollo I think they would be better off re-implementing this from scratch.

@abdavid
Copy link
Author

abdavid commented Aug 30, 2023

@shawnmcknight more or less a complete drop-in replacement, thanks for your awesome work. Though I get what you mean that it needs a little polish, some more optional types and more examples will go along way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants