mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 17:41:43 -05:00
Fix pollInterval SSR issue (see https://github.com/apollographql/apollo-client/issues/1704#issuecomment-322995855)
This commit is contained in:
parent
0232225d45
commit
b2a3e04fcf
2 changed files with 11 additions and 2 deletions
|
@ -47,7 +47,7 @@ import find from 'lodash/find';
|
|||
export default function withMulti(options) {
|
||||
// console.log(options)
|
||||
|
||||
const {
|
||||
let {
|
||||
limit = 10,
|
||||
pollInterval = getSetting('pollInterval', 20000),
|
||||
enableTotal = true,
|
||||
|
@ -55,6 +55,10 @@ export default function withMulti(options) {
|
|||
extraQueries
|
||||
} = options;
|
||||
|
||||
// if this is the SSR process, set pollInterval to null
|
||||
// see https://github.com/apollographql/apollo-client/issues/1704#issuecomment-322995855
|
||||
pollInterval = typeof window === 'undefined' ? null : pollInterval;
|
||||
|
||||
const { collectionName, collection } = extractCollectionInfo(options);
|
||||
const { fragmentName, fragment } = extractFragmentInfo(options, collectionName);
|
||||
|
||||
|
|
|
@ -5,7 +5,12 @@ import gql from 'graphql-tag';
|
|||
import { getSetting, singleClientTemplate, Utils, extractCollectionInfo, extractFragmentInfo } from 'meteor/vulcan:lib';
|
||||
|
||||
export default function withSingle(options) {
|
||||
const { pollInterval = getSetting('pollInterval', 20000), enableCache = false, extraQueries } = options;
|
||||
|
||||
let { pollInterval = getSetting('pollInterval', 20000), enableCache = false, extraQueries } = options;
|
||||
|
||||
// if this is the SSR process, set pollInterval to null
|
||||
// see https://github.com/apollographql/apollo-client/issues/1704#issuecomment-322995855
|
||||
pollInterval = typeof window === 'undefined' ? null : pollInterval;
|
||||
|
||||
const { collectionName, collection } = extractCollectionInfo(options);
|
||||
const { fragmentName, fragment } = extractFragmentInfo(options, collectionName);
|
||||
|
|
Loading…
Add table
Reference in a new issue