mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
* refactor(graphql): Introduce image type * Undo changes to .travis.yml * chore: Upgrade travis to node LTS - URL is available since v10 * chore: use lts Co-authored-by: mattwr18 <mattwr18@gmail.com>
102 lines
1.4 KiB
JavaScript
102 lines
1.4 KiB
JavaScript
import gql from 'graphql-tag'
|
|
|
|
export const userFragment = gql`
|
|
fragment user on User {
|
|
id
|
|
slug
|
|
name
|
|
avatar {
|
|
url
|
|
}
|
|
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
|
|
followingCount
|
|
followedByCurrentUser
|
|
}
|
|
`
|
|
|
|
export const postFragment = gql`
|
|
fragment post on Post {
|
|
id
|
|
title
|
|
content
|
|
contentExcerpt
|
|
createdAt
|
|
updatedAt
|
|
disabled
|
|
deleted
|
|
slug
|
|
language
|
|
image {
|
|
url
|
|
sensitive
|
|
aspectRatio
|
|
}
|
|
author {
|
|
...user
|
|
}
|
|
pinnedAt
|
|
pinned
|
|
}
|
|
`
|
|
|
|
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
|
|
}
|
|
`
|