roschaefer deefc4e12f Improve notification query performance
Just don't ask for stuff that you don't want to show anyways
2019-12-10 18:09:32 +01:00

92 lines
1.2 KiB
JavaScript

import gql from 'graphql-tag'
export const linkableUserFragment = lang => gql`
fragment user on User {
id
slug
name
avatar
disabled
deleted
}
`
export const userFragment = lang => gql`
fragment user on User {
id
slug
name
avatar
disabled
deleted
shoutedCount
contributionsCount
commentedCount
followedByCount
followedByCurrentUser
location {
name: name${lang}
}
badges {
id
icon
}
}
`
export const postCountsFragment = gql`
fragment postCounts on Post {
commentsCount
shoutedCount
shoutedByCurrentUser
emotionsCount
}
`
export const postFragment = lang => gql`
fragment post on Post {
id
title
content
contentExcerpt
createdAt
updatedAt
disabled
deleted
slug
image
language
author {
...user
}
tags {
id
}
categories {
id
slug
name
icon
}
pinnedBy {
id
name
role
}
pinnedAt
imageAspectRatio
}
`
export const commentFragment = lang => gql`
fragment comment on Comment {
id
createdAt
updatedAt
disabled
deleted
content
contentExcerpt
author {
...user
}
}
`