info contain slugs only

This commit is contained in:
tonyrewin 2022-06-17 16:11:18 +03:00
parent dc2f62d300
commit 50d2845c23
3 changed files with 9 additions and 8 deletions

View File

@ -32,11 +32,12 @@ nginx -s reload
poetry install
poetry run python server.py
poetry run python server.py inbox
```
## Data prepare
Notice: you need db.sqlite3 file in your root folder or you have to migrate some data to see.
Also, you'll need to migrate some data
```
poetry run python migrate.py all

View File

@ -25,7 +25,7 @@ def _get_user_subscribed_topic_slugs(slug):
def _get_user_subscribed_authors(slug):
with local_session() as session:
authors = session.query(User).\
authors = session.query(User.slug).\
join(AuthorSubscription, User.slug == AuthorSubscription.author).\
where(AuthorSubscription.subscriber == slug)
return authors

View File

@ -7,10 +7,10 @@ type Result {
}
type CurrentUserInfo {
totalUnreadMessages : Int
userSubscribedTopics : [String]!
userSubscribedAuthors : [User]!
userSubscribedCommunities : [String]!
totalUnreadMessages: Int
userSubscribedTopics: [String]!
userSubscribedAuthors: [String]!
userSubscribedCommunities: [String]!
}
type AuthResult {
@ -135,8 +135,8 @@ type Mutation {
updateCommunity(community: CommunityInput!): Community!
deleteCommunity(id: Int!): Result!
subscribe(subscription : SubscriptionType!, slug: String!): Result!
unsubscribe(subscription : SubscriptionType!, slug: String!): Result!
subscribe(what: SubscriptionType!, slug: String!): Result!
unsubscribe(what: SubscriptionType!, slug: String!): Result!
}
################################### Query