Conversation
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
MasterOdin
commented
Nov 30, 2025
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [12.x, 14.x, 20.x] |
Collaborator
Author
There was a problem hiding this comment.
@apollo/client@4 uses null chainging (added in node 14) and ||= operator (added in node 15), so have to drop those versions from testing for it.
| } | ||
| return execute.length === 3 | ||
| // @ts-ignore | ||
| ? execute(link, operation, { client: apolloClientInstance }) |
Collaborator
Author
There was a problem hiding this comment.
execute in @apollo/client@4 requires passing the client that initiating the execute, so this wrapper acts as a shim around that to support both 3 and 4.
| "graphql-tag": "^2.12.6", | ||
| "jest": "^28.1.3", | ||
| "jest-environment-jsdom": "^28.1.3", | ||
| "rxjs": "^7.8.2", |
Collaborator
Author
There was a problem hiding this comment.
New peer dependency for @apollo/client@4.
Collaborator
Author
|
Closing this in favor of #86. While having the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #82
PR adds support for
@apollo/client@^4in the library.The biggest change necessary for it was moving from compiling the library for
es5toes2015as@apollo/clientnow exposes a proper es2015 class, and so errors under es5. Luckily@apollo/client@3happily works with either. While this is a breaking change, per https://node.green/, anyone using node 6+ is compatible with it, where node 6 was released 9 years ago and hit end of life 7 years ago. At this point, I think anyone still using such an old version of node is also probably not bothering to update their libraries either.Secondarily,
@apollo/client@4reworked a number of imports, and so to work around this I added a newtypes.tsfile, which uses conditional types to hopefully provide downstream users useful type information. Given I'm bridging two different versions, this necessitated adding a bunch of@ts-ignoreto the file due to missing types on v3 and v4 to get it working for testing. Unfortunately, building the library against@apollo/client@3will throw a bunch of type errors still:type errors
These errors can be avoided by ensuring you have set
"skipLibCheck": trueto yourtsconfig.json(which is set by default on a freshtsc --initrun) so I think that's acceptable, and I've added a note about it.Given this, probably makes sense to have this be another major release. We could also just drop support for
@apollo/client@3on the new major version, and only support@apollo/client@4, and then keep the5.xline alive minimally for any new backwards compatible bugfixes or features that might exist as per the stats on https://www.npmjs.com/package/@apollo/client?activeTab=versions,@apollo/client@3is still installed more in the past 7 days.