add community subscription; unify subscription interface

This commit is contained in:
knst-kotov
2022-06-12 10:51:22 +03:00
parent f89cb47daf
commit 39070dc359
6 changed files with 76 additions and 33 deletions

View File

@@ -93,6 +93,12 @@ type CommentUpdatedResult {
comment: Comment
}
enum SubscriptionType {
TOPIC
AUTHOR
COMMUNITY
}
################################### Mutation
type Mutation {
@@ -118,8 +124,6 @@ type Mutation {
# topics
createTopic(input: TopicInput!): TopicResult!
updateTopic(input: TopicInput!): TopicResult!
topicSubscribe(slug: String!): Result!
topicUnsubscribe(slug: String!): Result!
createComment(body: String!, shout: String!, replyTo: Int): CommentResult!
updateComment(id: Int!, body: String!): CommentResult!
@@ -130,8 +134,8 @@ type Mutation {
updateCommunity(community: CommunityInput!): Community!
deleteCommunity(id: Int!): Result!
authorSubscribe(slug: String!): Result!
authorUnsubscribe(slug: String!): Result!
subscribe(subscription : SubscriptionType!, slug: String!): Result!
unsubscribe(subscription : SubscriptionType!, slug: String!): Result!
}
################################### Query