mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 18:11:40 -05:00
Simplify custom fragment code
This commit is contained in:
parent
591385b0f8
commit
dce38c1a28
1 changed files with 3 additions and 43 deletions
|
@ -1,52 +1,12 @@
|
|||
import { registerFragment } from 'meteor/nova:lib';
|
||||
import { registerFragment, getFragment } from 'meteor/nova:lib';
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
const CustomPostsListFragment = gql`
|
||||
fragment CustomPostsList on Post {
|
||||
_id
|
||||
title
|
||||
url
|
||||
slug
|
||||
thumbnailUrl
|
||||
postedAt
|
||||
sticky
|
||||
status
|
||||
categories {
|
||||
# ...minimumCategoryInfo
|
||||
_id
|
||||
name
|
||||
slug
|
||||
}
|
||||
commentCount
|
||||
commenters {
|
||||
# ...avatarUserInfo
|
||||
_id
|
||||
displayName
|
||||
emailHash
|
||||
slug
|
||||
}
|
||||
upvoters {
|
||||
_id
|
||||
}
|
||||
downvoters {
|
||||
_id
|
||||
}
|
||||
upvotes
|
||||
downvotes
|
||||
baseScore
|
||||
score
|
||||
viewCount
|
||||
clickCount
|
||||
user {
|
||||
# ...avatarUserInfo
|
||||
_id
|
||||
displayName
|
||||
emailHash
|
||||
slug
|
||||
}
|
||||
userId
|
||||
...PostsList
|
||||
color # new custom property!
|
||||
}
|
||||
${getFragment('PostsList')}
|
||||
`;
|
||||
|
||||
registerFragment(CustomPostsListFragment, 'PostsList');
|
||||
|
|
Loading…
Add table
Reference in a new issue