Vulcan/packages/example-forum/lib/modules/fragments.js

62 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-09-04 18:37:21 +09:00
import { registerFragment } from 'meteor/vulcan:core';
// ------------------------------ Vote ------------------------------ //
// note: fragment used by default on the UsersProfile fragment
2017-09-04 19:56:33 +09:00
// registerFragment(`
// fragment VotedItem on Vote {
// # vulcan:voting
// itemId
// power
// votedAt
// }
// `);
2017-09-04 18:37:21 +09:00
// ------------------------------ Users ------------------------------ //
// note: fragment used by default on UsersProfile, PostsList & CommentsList fragments
registerFragment(`
fragment UsersMinimumInfo on User {
# vulcan:users
_id
slug
username
displayName
emailHash
avatarUrl
}
`);
registerFragment(`
fragment UsersProfile on User {
# vulcan:users
...UsersMinimumInfo
createdAt
isAdmin
bio
htmlBio
twitterUsername
website
groups
karma
# vulcan:posts
postCount
# vulcan:comments
commentCount
# vulcan:voting
2017-09-04 19:56:33 +09:00
#downvotedComments {
# ...VotedItem
#}
#downvotedPosts {
# ...VotedItem
#}
#upvotedComments {
# ...VotedItem
#}
#upvotedPosts {
# ...VotedItem
#}
2017-09-04 18:37:21 +09:00
}
`);