diff --git a/app/src/main/graphql/fragments.graphql b/app/src/main/graphql/fragments.graphql index d2986c5c3a..29e9e76a17 100644 --- a/app/src/main/graphql/fragments.graphql +++ b/app/src/main/graphql/fragments.graphql @@ -83,6 +83,17 @@ fragment reward on Reward { rewardType } +fragment comment on Comment { + id + author { + ...user + } + body + deleted + parentId + createdAt +} + fragment shippingRule on ShippingRule { cost { ... amount @@ -95,9 +106,12 @@ fragment shippingRule on ShippingRule { fragment user on User { name id - imageUrl(blur: false, width: 54) + imageUrl(blur: false, width: 54), + isCreator } + + fragment amount on Money { amount currency @@ -110,6 +124,13 @@ fragment location on Location { name } +fragment pageInfo on PageInfo { + hasPreviousPage + hasNextPage + startCursor + endCursor +} + fragment payment on CreditCard { id lastFour diff --git a/app/src/main/graphql/project.graphql b/app/src/main/graphql/project.graphql index 0336e82d05..4bcfd374da 100644 --- a/app/src/main/graphql/project.graphql +++ b/app/src/main/graphql/project.graphql @@ -32,3 +32,42 @@ query GetProjectAddOns($slug: String!, $locationId: ID!) { } } } + +query GetProjectComments($slug: String!, $cursor: String){ + project(slug: $slug) { + collaborators { + edges { + node { + id + name + } + } + } + comments(after: $cursor) { + edges { + cursor + node { + authorBadges + ...comment + replies { + edges { + cursor + node { + ...comment + } + } + pageInfo { + ...pageInfo + } + totalCount + } + } + } + pageInfo { + ...pageInfo + } + totalCount + } + } + } +