Robert Schäfer 95a06a8344 Refactor all badges resolvers to use neode
FYI: @Tirokk I think we'll never remove or add new badges through
graphql. Instead, we will seed them manually with direct access to the
database. Therefore I removed the respective mutations and also your
tests regarding permissions.
2019-07-10 14:36:42 +02:00

77 lines
1.4 KiB
JavaScript

import gql from 'graphql-tag'
export default i18n => {
const lang = i18n.locale().toUpperCase()
return gql(`
query User($id: ID!) {
User(id: $id) {
id
slug
name
avatar
about
disabled
deleted
locationName
location {
name: name${lang}
}
createdAt
badges {
key
icon
}
badgesCount
shoutedCount
commentedCount
followingCount
following(first: 7) {
id
slug
name
avatar
disabled
deleted
followedByCount
followedByCurrentUser
contributionsCount
commentsCount
badges {
key
icon
}
location {
name: name${lang}
}
}
followedByCount
followedByCurrentUser
followedBy(first: 7) {
id
slug
name
disabled
deleted
avatar
followedByCount
followedByCurrentUser
contributionsCount
commentsCount
badges {
key
icon
}
location {
name: name${lang}
}
}
contributionsCount
socialMedia {
id
url
}
}
}
`)
}