This commit is contained in:
SachaG 2018-12-28 09:16:07 +09:00
parent 0232225d45
commit b2a3e04fcf
2 changed files with 11 additions and 2 deletions

View file

@ -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);

View file

@ -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);