-
Notifications
You must be signed in to change notification settings - Fork 72
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
Apollo service is initializes during integration test without its options #52
Comments
@bgentry I've updated the issue with some to references to what I'm talking about. |
I might be wrong, but I guess this part of the code was discussed with @dfreeman too, but the discussion was lost due to some rebase or forced push into #20. |
I believe you could get rid of the initializer entirely if you update the service to do something like: options: computed(function() {
const config = getOwner(this).resolveRegistration('config:environment');
return config.apollo;
}) |
Released in v0.4.5, thanks especially to @dfreeman for having all the answers ✌️ |
Thank you, guys! |
So, the base-query-manager mixin, during the #20 development, was using a query manager got with
owner.lookup
. The Apollo service was not injected by the mixin.Today the query manager is got from the Apollo service, that's always injected by the mixin. This is causing an error on integration tests because now the service initializes during the test, but the initializer that injects the options into the service doesn't run during the test. Then Apollo client raises an error saying that the network layer needs an endpoint.
How are you handling this? Are you writing integration tests?
The text was updated successfully, but these errors were encountered: