Vulcan/packages/vulcan-voting/lib/client/fragment_matcher.js

12 lines
438 B
JavaScript

import { VoteableCollections } from '../modules/make_voteable.js';
import { addToFragmentMatcher, addCallback } from 'meteor/vulcan:core';
function AddVoteableFragmentMatcher() {
addToFragmentMatcher({
kind: 'UNION',
name: 'Voteable',
possibleTypes: VoteableCollections.map(collection => ({name: collection.options.collectionName}))
});
return {};
}
addCallback('apolloclient.init.before', AddVoteableFragmentMatcher);