diff --git a/aleksis/core/frontend/app/apollo.js b/aleksis/core/frontend/app/apollo.js index cc468b8e9550cf83f7d27de2ab547734f44b5526..c1cf08a8b3510f19dae8dc1e7bc8b49f72fd2fb1 100644 --- a/aleksis/core/frontend/app/apollo.js +++ b/aleksis/core/frontend/app/apollo.js @@ -50,9 +50,15 @@ const apolloOpts = { defaultClient: apolloClient, defaultOptions: { $query: { - skip: (vm) => { - // We only want to run this query when background activity is on and we are not reported offline - return !vm.$root.backgroundActive || vm.$root.offline; + skip: function (vm, queryKey) { + if (queryKey in vm.$_apollo.queries) { + // We only want to run this query when background activity is on and we are not reported offline + return !!( + vm.$_apollo.queries[queryKey].options.pollInterval && + (!vm.$root.backgroundActive || vm.$root.offline) + ); + } + return false; }, error: ({ graphQLErrors, networkError }, vm) => { if (graphQLErrors) {