2019-12-17 07:39:26 +01:00

96 lines
1.3 KiB
JavaScript

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