mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Split 'locationAndBadgesFragment' into 'locationFragment' and 'badgesFragment'
This commit is contained in:
parent
04810ca500
commit
e8d21147ae
@ -13,13 +13,19 @@ export const userFragment = gql`
|
||||
}
|
||||
`
|
||||
|
||||
export const locationAndBadgesFragment = (lang) => gql`
|
||||
fragment locationAndBadges on User {
|
||||
export const locationFragment = (lang) => gql`
|
||||
fragment location on User {
|
||||
locationName
|
||||
location {
|
||||
name: name${lang}
|
||||
lng
|
||||
lat
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const badgesFragment = gql`
|
||||
fragment badges on User {
|
||||
badges {
|
||||
id
|
||||
icon
|
||||
|
||||
@ -5,7 +5,8 @@ import {
|
||||
commentFragment,
|
||||
postCountsFragment,
|
||||
userCountsFragment,
|
||||
locationAndBadgesFragment,
|
||||
locationFragment,
|
||||
badgesFragment,
|
||||
tagsCategoriesAndPinnedFragment,
|
||||
} from './Fragments'
|
||||
|
||||
@ -14,7 +15,8 @@ export default (i18n) => {
|
||||
return gql`
|
||||
${userFragment}
|
||||
${userCountsFragment}
|
||||
${locationAndBadgesFragment(lang)}
|
||||
${locationFragment(lang)}
|
||||
${badgesFragment}
|
||||
${postFragment}
|
||||
${postCountsFragment}
|
||||
${tagsCategoriesAndPinnedFragment}
|
||||
@ -28,7 +30,8 @@ export default (i18n) => {
|
||||
author {
|
||||
...user
|
||||
...userCounts
|
||||
...locationAndBadges
|
||||
...location
|
||||
...badges
|
||||
blocked
|
||||
}
|
||||
comments(orderBy: createdAt_asc) {
|
||||
@ -36,7 +39,8 @@ export default (i18n) => {
|
||||
author {
|
||||
...user
|
||||
...userCounts
|
||||
...locationAndBadges
|
||||
...location
|
||||
...badges
|
||||
}
|
||||
}
|
||||
group {
|
||||
@ -54,7 +58,8 @@ export const filterPosts = (i18n) => {
|
||||
return gql`
|
||||
${userFragment}
|
||||
${userCountsFragment}
|
||||
${locationAndBadgesFragment(lang)}
|
||||
${locationFragment(lang)}
|
||||
${badgesFragment}
|
||||
${postFragment}
|
||||
${postCountsFragment}
|
||||
${tagsCategoriesAndPinnedFragment}
|
||||
@ -67,7 +72,8 @@ export const filterPosts = (i18n) => {
|
||||
author {
|
||||
...user
|
||||
...userCounts
|
||||
...locationAndBadges
|
||||
...location
|
||||
...badges
|
||||
}
|
||||
group {
|
||||
id
|
||||
@ -84,7 +90,8 @@ export const profilePagePosts = (i18n) => {
|
||||
return gql`
|
||||
${userFragment}
|
||||
${userCountsFragment}
|
||||
${locationAndBadgesFragment(lang)}
|
||||
${locationFragment(lang)}
|
||||
${badgesFragment}
|
||||
${postFragment}
|
||||
${postCountsFragment}
|
||||
${tagsCategoriesAndPinnedFragment}
|
||||
@ -102,7 +109,8 @@ export const profilePagePosts = (i18n) => {
|
||||
author {
|
||||
...user
|
||||
...userCounts
|
||||
...locationAndBadges
|
||||
...location
|
||||
...badges
|
||||
}
|
||||
group {
|
||||
id
|
||||
@ -127,7 +135,8 @@ export const relatedContributions = (i18n) => {
|
||||
return gql`
|
||||
${userFragment}
|
||||
${userCountsFragment}
|
||||
${locationAndBadgesFragment(lang)}
|
||||
${locationFragment(lang)}
|
||||
${badgesFragment}
|
||||
${postFragment}
|
||||
${postCountsFragment}
|
||||
${tagsCategoriesAndPinnedFragment}
|
||||
@ -140,7 +149,8 @@ export const relatedContributions = (i18n) => {
|
||||
author {
|
||||
...user
|
||||
...userCounts
|
||||
...locationAndBadges
|
||||
...location
|
||||
...badges
|
||||
}
|
||||
relatedContributions(first: 2) {
|
||||
...post
|
||||
@ -149,7 +159,8 @@ export const relatedContributions = (i18n) => {
|
||||
author {
|
||||
...user
|
||||
...userCounts
|
||||
...locationAndBadges
|
||||
...location
|
||||
...badges
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import gql from 'graphql-tag'
|
||||
import {
|
||||
userCountsFragment,
|
||||
locationAndBadgesFragment,
|
||||
locationFragment,
|
||||
badgesFragment,
|
||||
userFragment,
|
||||
postFragment,
|
||||
commentFragment,
|
||||
@ -12,15 +13,16 @@ export const profileUserQuery = (i18n) => {
|
||||
return gql`
|
||||
${userFragment}
|
||||
${userCountsFragment}
|
||||
${locationAndBadgesFragment(lang)}
|
||||
${locationFragment(lang)}
|
||||
${badgesFragment}
|
||||
|
||||
query User($id: ID!, $followedByCount: Int!, $followingCount: Int!) {
|
||||
User(id: $id) {
|
||||
...user
|
||||
...userCounts
|
||||
...locationAndBadges
|
||||
...location
|
||||
...badges
|
||||
about
|
||||
locationName
|
||||
createdAt
|
||||
followedByCurrentUser
|
||||
isMuted
|
||||
@ -29,12 +31,14 @@ export const profileUserQuery = (i18n) => {
|
||||
following(first: $followingCount) {
|
||||
...user
|
||||
...userCounts
|
||||
...locationAndBadges
|
||||
...location
|
||||
...badges
|
||||
}
|
||||
followedBy(first: $followedByCount) {
|
||||
...user
|
||||
...userCounts
|
||||
...locationAndBadges
|
||||
...location
|
||||
...badges
|
||||
}
|
||||
socialMedia {
|
||||
id
|
||||
@ -86,6 +90,24 @@ export const adminUserQuery = () => {
|
||||
`
|
||||
}
|
||||
|
||||
export const mapUserQuery = (i18n) => {
|
||||
const lang = i18n.locale().toUpperCase()
|
||||
return gql`
|
||||
${userFragment}
|
||||
${locationFragment(lang)}
|
||||
${badgesFragment}
|
||||
|
||||
query User() {
|
||||
User() {
|
||||
...user
|
||||
...userCounts
|
||||
...location
|
||||
...badges
|
||||
}
|
||||
}
|
||||
`
|
||||
}
|
||||
|
||||
export const notificationQuery = (i18n) => {
|
||||
return gql`
|
||||
${userFragment}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user