From 30c8de935c7c17ebef79e545db95b30c0d7e1f5e Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 27 Jul 2020 07:59:13 -0700 Subject: [PATCH] fix(ssr): ignore pollInterval on server (#908) --- packages/vue-apollo/src/smart-query.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/vue-apollo/src/smart-query.js b/packages/vue-apollo/src/smart-query.js index 4cc11391..62b0082c 100644 --- a/packages/vue-apollo/src/smart-query.js +++ b/packages/vue-apollo/src/smart-query.js @@ -79,6 +79,17 @@ export default class SmartQuery extends SmartApollo { } } + generateApolloOptions (variables) { + const apolloOptions = super.generateApolloOptions(variables) + + if (this.vm.$isServer) { + // Don't poll on the server, that would run indefinitely + delete apolloOptions.pollInterval + } + + return apolloOptions + } + executeApollo (variables) { const variablesJson = JSON.stringify(variables)