-
Notifications
You must be signed in to change notification settings - Fork 9
/
collection.js
43 lines (38 loc) · 1.17 KB
/
collection.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { createCollection } from 'meteor/vulcan:core';
import schema from './schema.js';
import './fragments.js';
const <%= collectionName %> = createCollection({
collectionName: '<%= collectionName %>',
typeName: '<%= typeName %>',
schema,
// resolvers: yourCustomResolvers // null to disable default resolvers generation
// mutations: yourCustomMutations // null to disable default mutations generation
permissions: {
canRead: ['members'],
canCreate: ['members'],
canUpdate: ['owners', 'admins'],
canDelete: ['owners', 'admins']
},
//callbacks: {
// create: {
// before: []
// }
//},
//customFilters: [
// {
// name: "_withRatings",
// argument: "average: Int",
// filter: ({ input, context, filterArguments }) => {
// const { average } = filterArguments;
// const { Reviews } = context;
// // get all movies that have an average review score of X stars
// const xStarReviewsMoviesIds = getMoviesByScore(average);
// return {
// selector: { _id: { $in: xStarReviewsMoviesIds } },
// options: {}
// }
// }
// }
//]
});
export default <%= collectionName %>;