mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 19:11:38 -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';
|
import gql from 'graphql-tag';
|
||||||
|
|
||||||
const CustomPostsListFragment = gql`
|
const CustomPostsListFragment = gql`
|
||||||
fragment CustomPostsList on Post {
|
fragment CustomPostsList on Post {
|
||||||
_id
|
...PostsList
|
||||||
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
|
|
||||||
color # new custom property!
|
color # new custom property!
|
||||||
}
|
}
|
||||||
|
${getFragment('PostsList')}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
registerFragment(CustomPostsListFragment, 'PostsList');
|
registerFragment(CustomPostsListFragment, 'PostsList');
|
||||||
|
|
Loading…
Add table
Reference in a new issue