Instead of specifying @queryManager({ service: 'apollo-override' }) apollo;everywhere, It might be interesting to have a service override environment variable as such:
export function queryManager(...theArgs) {
let setupQueryManager = computed(function () {
let config = getOwner(this).resolveRegistration('config:environment');
let serviceName = config.apollo.serviceOverride || 'apollo';
let [options] = theArgs;
if (typeof options === 'object' && options.service) {
serviceName = options.service;
}
const service = getOwner(this).lookup(`service:${serviceName}`);
const queryManager = new QueryManager(service);
setupHooks(queryManager, this);
return queryManager;
});
the default apollo service would be used if no override service would be defined and you could still specify a completely different service instead by doing @queryManager({ service: 'apollo-special-case' }) apollo; for the edge cases.
Instead of specifying
@queryManager({ service: 'apollo-override' }) apollo;
everywhere, It might be interesting to have a service override environment variable as such:Seems an easy addition.
https://github.com/ember-graphql/ember-apollo-client/blob/99712f01a8918570a7a6455341d665602b7c70f7/addon/-private/apollo/query-manager.js#L27-L39
Could become this:
the default apollo service would be used if no override service would be defined and you could still specify a completely different service instead by doing
@queryManager({ service: 'apollo-special-case' }) apollo;
for the edge cases.