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