Upgrade with confidence – dealing with issues while upgrading libraries
summary
Project uses Angular + GraphQL with apollo-client v2 and upgrading breaks because v2 removes observable variables; documentation omits that. Fixes trialed: merge variable observables with combineLatest + switchMap and call watchQuery repeatedly (works but recreates queries), then create a persistent queryRef and call queryRef.setVariables to trigger results, and finally implement an Apollo Link middleware that intercepts operations, flattens observable vars into plain objects and forwards them. Result: solution works mostly but required wrapping variables in the operation context to avoid edge cases.
AI-written summary · about
chapters (6)
- 0:00Intro
- 1:43What's the story
- 2:54Let's upgrade
- 4:05Long story short
- 5:46First solution
- 7:45The ultimate goal
related talks
28mLarge scale refactoring: from start to finish
31mGraphQL ecosystem walkthrough
28mRefactoring Your Way Up
09mCommon Angular Gotchas
23mGraphQL in real life
23mUntangling Your Dependencies: A Pattern for a Well-Knit JavaScript Project
27mThe ultimate GraphQL client development experience
21mStreamlining the AngularJS-to-Angular migration
