According to ember's documentation, the function beforeModel on routes can return Promises.
The previous implementation of ember-apollo-client did not allow to correctly use both async beforeModel & @queryManager on a route. Because of the override done by the plugin, it was not possible to await for the result of a beforeModel method.
With this fix,
when a hooked function returns a Promise, a promise is returned by the hooked function, allowing to wait for its completion.
when a hooked function does not return a Promise, it works as before.
According to ember's documentation, the function
beforeModel
on routes can return Promises.The previous implementation of
ember-apollo-client
did not allow to correctly use bothasync beforeModel
&@queryManager
on a route. Because of the override done by the plugin, it was not possible toawait
for the result of abeforeModel
method.With this fix,
Promise
, a promise is returned by the hooked function, allowing to wait for its completion.Promise
, it works as before.