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 install
poetry run python server.py poetry run python server.py
poetry run python server.py inbox
``` ```
## Data prepare ## 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 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): def _get_user_subscribed_authors(slug):
with local_session() as session: with local_session() as session:
authors = session.query(User).\ authors = session.query(User.slug).\
join(AuthorSubscription, User.slug == AuthorSubscription.author).\ join(AuthorSubscription, User.slug == AuthorSubscription.author).\
where(AuthorSubscription.subscriber == slug) where(AuthorSubscription.subscriber == slug)
return authors return authors

View File

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