Skip to content

Commit

Permalink
fix(ssr): ignore pollInterval on server (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 authored Jul 27, 2020
1 parent 6f3dc44 commit 30c8de9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/vue-apollo/src/smart-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 30c8de9

Please sign in to comment.