imporved queries

This commit is contained in:
Grzegorz Leoniec 2018-10-16 09:42:28 +02:00
parent c8b1125250
commit cf08efa19f
2 changed files with 18 additions and 19 deletions

View File

@ -14,7 +14,18 @@ export default gql(`
avatar avatar
} }
badgesCount badgesCount
shoutedCount
commentsCount
followingCount followingCount
following {
id
name
slug
avatar
followedByCount
contributionsCount
commentsCount
}
followedByCount followedByCount
contributionsCount contributionsCount
contributions { contributions {
@ -28,6 +39,7 @@ export default gql(`
image image
author { author {
User { User {
id
avatar avatar
name name
} }

View File

@ -46,7 +46,7 @@ export default {
Post: { Post: {
query: gql(` query: gql(`
query { query {
Post { Post(first:10, orderBy: shoutedCount_desc) {
id id
title title
contentExcerpt contentExcerpt
@ -54,34 +54,21 @@ export default {
image image
author { author {
User { User {
id
avatar avatar
slug slug
name name
contributionsCount
shoutedCount
commentsCount
followedByCount
} }
} }
tags {
name
}
commentsCount commentsCount
comments(orderBy: _id_desc) {
id
content
author {
User {
name
}
}
}
categories { categories {
name name
} }
shoutedCount shoutedCount
shoutedBy {
name
friends {
name
}
}
} }
} }
`), `),