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

Support for Apollo Client 3 #237

Closed
GoranZic opened this issue Nov 12, 2019 · 21 comments
Closed

Support for Apollo Client 3 #237

GoranZic opened this issue Nov 12, 2019 · 21 comments
Assignees
Labels
Blocked ⛔️ blocking Prevents production or dev due to perf, bug, build error, etc.. enhancement💡 question❔
Milestone

Comments

@GoranZic
Copy link

Apollo-client 3 is in the beta phase now. One of its bigger changes is that apollo-link is now part of @apollo/client.

I tried using the apollo-client beta version, however I am unable to use apollo-link-rest with it as it still references apollo-link, and I end up with two definitions of ApolloLink.

Is there roadmap when apollo-link-rest will be switched to the client? And more importantly is there a workaround to this problem?

@fbartho
Copy link
Collaborator

fbartho commented Nov 12, 2019

@GoranZic I think we need help or a specification on the changes needed to be compatible with Apollo-client 3. Is that something you can help us find?

@fbartho
Copy link
Collaborator

fbartho commented Nov 12, 2019

@benjamn @jbaxleyiii @hwillson — do you have a specification for how to make links forwards/backwards compatible with ApolloClient 3 and 2.x at the same time?

@fbartho fbartho added Blocked ⛔️ blocking Prevents production or dev due to perf, bug, build error, etc.. enhancement💡 help wanted 🛠 question❔ labels Nov 12, 2019
@GoranZic
Copy link
Author

This is the best I could find.
Okay here's the relevant pull request in apollo-client:
apollographql/apollo-client#5412
And here's the relevant pull request from apollo-link project:
apollographql/apollo-link#1158

@fbartho
Copy link
Collaborator

fbartho commented Nov 12, 2019

Reading between the lines, I think we’re going to need breaking changes here :-(

@hwillson
Copy link
Member

@fbartho the required changes should be fairly minimal. Everything from the apollo-link, apollo-link-http and apollo-link-http-common packages should now be pulled from @apollo/client. We're going to major version bump the packages in apollographql/apollo-link#1158, due to the @apollo/client requirement. So anyone who wants to keep using apollo-client will use the older link versions, whereas anyone who wants to use @apollo/client will use the new versions.

I can submit a PR that introduces the required changes for @apollo/client. Let me know if that's okay, or if you would prefer to look into this yourself.

@fbartho
Copy link
Collaborator

fbartho commented Nov 12, 2019

It’d be lovely if you know what changes are needed!

We haven’t officially shipped this as 1.0 yet, so I guess we’re still in Breaking changes may occur with ever release-land.

@hwillson
Copy link
Member

Haha - sounds good. I'll get a PR prepped shortly.

@hwillson hwillson self-assigned this Nov 12, 2019
@stramel
Copy link

stramel commented Nov 12, 2019

@fbartho Since this package is still 0.x.y releases, you are able to perform breaking changes in a minor bump. It would be best to document the breaking change so that users are aware. I believe that NPM using ^0.7.0 would only bump the patch anyways.

@chrisber
Copy link

@hwillson If I'm not mistaken when reading Migrating to Apollo Client 3.0 the apollo-link-rest packages was left out from the migration process. Is there a reason why it was left out?

Also confusing is that the apollo docs 3.0 state that we should import { RestLink } from '@apollo/link-rest'; but there is no package on npm or in the apollo-link repository

@hwillson
Copy link
Member

Thanks for reviewing the migration guide @chrisber! #241 is going to be released when @apollo/client is live, but apollo-link-rest isn't specifically called out in the migration guide as the guide is currently just covering Apollo company managed projects (to help keep the guide shorter). That being said, I think you're right though - due to its popularity, we should mention it in the guide, which I'll do.

As for the @apollo/link-rest mention, that's a mistake! It should still be apollo-link-rest. The @apollo/link-X namespace is only going to be used for Apollo company maintained projects. I'll get that fixed. Thanks again!

@cpsnowden
Copy link

Any update on progressing the v0.8.0-beta release to integrate with Apollo Client 3?

@fbartho
Copy link
Collaborator

fbartho commented Feb 18, 2021

@cpsnowden I haven't received enough feedback about bugs or success of the beta build to feel comfortable shipping it as stable!

When I shipped the beta, shortly after that ApolloClient3's release date got pushed back for a few months, so I'm simply not aware if breaking changes occurred after that time.

Have you tried to use it yet? My team is hopefully moving to ApolloClient3 over the next month or so, so I figured if I don't get external feedback on the Beta before then, that we'll have to test into ourselves.

@fbartho fbartho added this to the 0.8.0 milestone Feb 18, 2021
@rgrove
Copy link

rgrove commented Feb 18, 2021

Hey @fbartho! I've been watching this ticket, but didn't realize you were waiting for feedback or I'd have spoken up sooner. 😄

We (SmugMug) have been using apollo-link-rest 0.8.0-beta.0 with Apollo 3 for several months now and haven't run into any issues! It was a painless upgrade as far as apollo-link-rest was concerned, and has been smooth sailing.

@fbartho
Copy link
Collaborator

fbartho commented Feb 18, 2021

That's great news! Thanks @rgrove!

So there you have it @cpsnowden -- the Beta is pretty stable then :P

-- I'm happy to tag & ship the official release in the next month or so -- If anybody has any features to squeeze into the milestone we can get it all officially out together!

@cpsnowden
Copy link

Awesome! Thanks @fbartho for the quick response and @rgrove for providing the feedback!

@dturcotte
Copy link

Just to chime in - I've been using v0.8.0-beta.0 since August 2020 always with the latest Apollo, and I've had no issues either 👍

@minox86
Copy link

minox86 commented Aug 5, 2021

Hi all. I'm trying to use v0.8.0-beta.0 with apollo client v3.4.5 but all queries remain in loading and no data is returned. I can see the REST call ended with success in browser network tools, but data from both useQuery and useLazyQuery hooks don't update. Even onCallback and onError callbacks are not called at all. The problem does not appear to be present in mutations.

Is there anyone that is experiencing this? Any idea about how to solve the problem?

I'm starting a project based on apollo client v3 and apollo-link-rest but this problem is blocking me from adopting this stack, please let me know if someone have similar problems.

@fbartho
Copy link
Collaborator

fbartho commented Aug 5, 2021

@minox86 — this is news to me. I’ve been a bit busy changing jobs and I’m way behind on merging this PR

Now that we know there’s an issue, would you mind filing a separate Github Ticket with reproduction steps so we can look into it? I’d like to get that fixed and ship v0.8.0! Thanks

@rgrove
Copy link

rgrove commented Aug 5, 2021

We're not yet using Apollo Client 3.4.5 in production (we're a few versions behind), but after seeing these comments I tested 3.4.5 today and it seems to be working fine alongside apollo-link-rest 0.8.0-beta.0.

@minox86 is it possible that the issue you're having could be caused by a custom link, custom fetch handler, or some other custom aspect of your particular configuration? Is there an earlier Apollo Client version that works for you?

@fbartho
Copy link
Collaborator

fbartho commented Aug 6, 2021

Thanks for the update @rgrove!

@fbartho
Copy link
Collaborator

fbartho commented Jan 5, 2022

This shipped in v0.8.0! Sorry for the lagged update!

@fbartho fbartho closed this as completed Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked ⛔️ blocking Prevents production or dev due to perf, bug, build error, etc.. enhancement💡 question❔
Projects
None yet
Development

No branches or pull requests

9 participants