josemarluedke / glimmer-apollo

Ember and Glimmer integration for Apollo Client.
https://glimmer-apollo.com
MIT License
39 stars 15 forks source link

Refactor setClient/getClient and others to use owner as a context #21

Closed josemarluedke closed 3 years ago

josemarluedke commented 3 years ago

This concept was originally introduced in #5 and later reverted in #6. Recently I have figured a way around to the original issue that made required to revert these changes (#20).

We now scope all the clients around the owner, allowing us to have multiple app instances without conflicting apollo clients.

Note that we automatically clear out the client when the context (object with owner) gets destroyed. Which removes the need to manually clear up a client.