Apollo Server V4 Breaking Changes: Time To Move Away?

preview_player
Показать описание
Apollo Server 4 is out, with lots of breaking changes. And more shockingly, they deprecated the widely used v2 and v3 immediately with an end-of-life of October 2023(!!). In this video I'll be listing the breaking changes and explaining why it might be time to move on.

What's included:
00:00 Intro
00:43 Apollo Server deprecation
01:39 Breaking changes Apollo Server v4
02:04 New package structure
05:00 Drop support for community web frameworks
05:40 Updated use of datasources
07:05 Dropped support community datasources
09:39 More breaking changes in Apollo Server v5
10:44 Alternatives


***

Subscribe to this channel to learn everything about web development.

Рекомендации по теме
Комментарии
Автор

Hi Roy! Thanks for your attention here! I'm the tech lead of Apollo Server (whose comment you showed midway through the video).

I'm not here to convince you to stay on Apollo Server — if you're happy with another GraphQL server, that's great! I do want to address a few small inaccuracies in your video, though.


- Re data sources, most of the community data sources you link are just a dozen lines of code wrapping a standard database client and in some cases adding caching functionality. If you want to keep using them, you can — just search the migration guide for "If you want to migrate quickly to Apollo Server 4 without altering your data sources" for a dozen lines of code to keep using them. That said, I think the artificial separation between "DataSources" and "the thousands of packages you may find on npm to let you access databases and other sources of data" was not particularly helpful to our users. None of the legacy DB datasources we link on our docs are particularly popular, presumably because most people realized that they didn't offer much of an add-on over the same mechanisms you use to talk to databases in any other server. But if you like using a wrapper around a popular DB client instead of that DB client directly (or for the DataSources that have a caching feature, you actually use the caching feature), just copy and paste a few lines from the migration guide and you can keep happily using the same packages you've been using!

- I think you're misinterpreting what I said about a future ASv5. Node v12 went out of LTS in April and as soon as that happened, huge numbers of popular npm packages put out a major version bump with no change other than "we no longer support Node v12". Node v14 will go out of LTS in April 2023, and I expect that we will also seek to stop actively supporting this unsupported version of Node at this time, which means we'll presumably be releasing Apollo Server v5 at that time. My statement here wasn't "hahaha, I am excited to write another lengthy migration guide" but "in fact, the next time we put out a major version, we expect it will merely consist of 'make sure your dependencies are updated'', and perhaps we'll change some defaults that you can revert". I'm sorry my text was unclear enough that you interpreted "we are excited that the next major version change will be significantly smaller than these two" as "we look forward to making upgrades challenging again soon" but I'm sure you can update your video to fix that misreading. Thanks!

davidglasser
Автор

Recently went through an AS3 to AS4 upgrade across multiple servers and gateways. It was relatively painless. AS4 comes across as a "clear a few decks" release from Apollo with the intent to lay pathways for easier future developments and feature releases.

The common "you're basically screwed" refrain and the reveal that building on apollo server means building on technical debt in the video comes across like FUD. I've developed software on all kinds of software frameworks (OSS, commercial, proprietary) - the AS3 to AS4 upgrade wasn't that dramatic. Of course YMMV - and for some setups there will be more disruption or work required. But the ebb and flow of intentional technical debt accumulation and clear down is a large part of any kind of sustained software development.

There's a rich and growing ecosystem for GraphQL out there. Apollo, The Guid, StepZen, Wundergraph all come to mind off hand...we're spoilt to be honest. I can only speak to a very narrow set of GraphQL experiences as an Apollo user (and member of their supergraph champions slack community) - but in terms of general software frameworks/stacks it's been a solid choice.

ralphdepping
Автор

Thanks for a great video. Do you have any input regarding @apollo/gateway? Will that work with apollo v.4?

vredurs
Автор

This video is inaccurate. 4 months have passed since Roy agreed he did not fully understand the details of the changes to Apollo Server 4. Yet he failed to correct it. Is this due to the fact that he works for an Apollo competitor, StepZen (now IBM)? I prefer transparency, so I'll state that our company happily uses Apollo Server and Studio. @Roy, please reconsider your ethics and update the video.

In the spirit of transparency, I also have close relations with the Apollo team, have been presented at GraphQL Summit, and frequently on the Supergraph Champions weekly "think tank" style calls where we discuss roadmap, challenges from startups to enterprise, and generally geek out on everything GraphQL. But in general, I'm very committed to GraphQL and the ecosystem - beyond Apollo.


@David Glasser, you're a rock star! Thanks for the outline you posted and for making it known that one confused but very popular Next.js tutorial caused so much confusion across the developer community. I hope history doesn't repeat with this video. In general, in our first months of embarking on GraphQL, our dev team encountered so many tutorials written by people who only knew frameworks at the surface level. It hurt us in the long run, but good experience on vetting the accuracy of sources of information. Also, 10000% agree with using native database drivers. In general, we see projects bloated with NPM packages that break away from best practices. I hope the Apollo team will launch a series of Apollo Server 4 videos ASAP, from migration, to architecture, and decisions like you outlined.

@Roy Derks, 4 months ago, David Glasser kindly outlined in detail the inaccuracies from your video, you even acknowledge that you recorded this based on your interpretation of docs and random threads on Reddit - but you didn't make any updates. You don't even mentioning it on your video description text or updated your blog post. Obviously, it's important to be loyal to your employer StepZen, but the role of Developer Relations is to communicate and distribute accurate knowledge, not misinformation guided by a paycheck or personal opinions. Overall, it's concerning to see this from people educating the developer community. Even David recommended another library in his response on Reddit, stating that for certain use cases that was a better choice. Integrity is everything in the dev community, we shouldn't be bringing sales/marketing-style tactics into the space. When you change jobs and move to another company, this accumulation of misinformation becomes like technical debt and ultimately affects your credibility.

davidemanuelsarabiainrecov
Автор

well major releases often introduce major changes.

You suggest graphql-yoga (among others) as an alternative.
well i've seen a tutorial about setting up graphql-yoga from french channel techwall that was made in march 2021 and it's deprecated too, the code to setup the yoga server has completely changed since too. I haven't looked at express in yoga, but i just figure out it's the very same story.

yannickcotten
Автор

Wow. Apollo Server has been my favorite library to build graphql. Actually did not know the graphql-expres library has been deprecated. Where can I find more info on this?

vcvcvcv
Автор

i just found out they're deprecating apollo-server-express too.. wtf man.. now i've got to refactor my code .. this is frustrating as hell .. anyway thanks for sharing

sourdurian
Автор

Can I use typegraphql with apollo version 4? I notice whenever I install typegraphql with apollo version 4 there's an error.

mannyswebtutorial
Автор

Great video and thanks for sharing these updates, I maintain some Projects built on apollo-server and don’t keep up-2-date with their roadmap, so hearing this news though disappointing it is super helpful for me to plan going forward. Thanks for the update 🙌🏻

mgan
Автор

Apopllo server is out, just migrate everythign to Mercurius + fastify. This has been my choice I ever made and GraphQL development is so much better now

huseyin