get_topics_paginated-fix
All checks were successful
Deploy on push / deploy (push) Successful in 56s
All checks were successful
Deploy on push / deploy (push) Successful in 56s
This commit is contained in:
parent
81a8bf3c58
commit
3c56fdfaea
|
@ -53,7 +53,6 @@
|
|||
- Implemented persistent Redis caching for topic queries (no TTL, invalidated only on changes)
|
||||
- Optimized topic retrieval with separate endpoints for different use cases:
|
||||
- `get_topics_all` - returns all topics without statistics for lightweight listing
|
||||
- `get_topics_paginated` - returns topics with statistics and pagination support
|
||||
- `get_topics_by_community` - adds pagination and optimized filtering by community
|
||||
- Added SQLAlchemy-managed indexes directly in ORM models for automatic schema maintenance
|
||||
- Created `sync_indexes()` function for automatic index synchronization during app startup
|
||||
|
|
|
@ -202,23 +202,6 @@ async def get_topics_all(_, _info):
|
|||
return await get_all_topics()
|
||||
|
||||
|
||||
# Запрос на получение тем с пагинацией и статистикой
|
||||
@query.field("get_topics_paginated")
|
||||
async def get_topics_paginated(_, _info, limit=100, offset=0, by=None):
|
||||
"""
|
||||
Получает список тем с пагинацией и статистикой.
|
||||
|
||||
Args:
|
||||
limit: Максимальное количество возвращаемых тем
|
||||
offset: Смещение для пагинации
|
||||
by: Опциональные параметры сортировки
|
||||
|
||||
Returns:
|
||||
list: Список тем с их статистикой
|
||||
"""
|
||||
return await get_topics_with_stats(limit, offset, None, by)
|
||||
|
||||
|
||||
# Запрос на получение тем по сообществу
|
||||
@query.field("get_topics_by_community")
|
||||
async def get_topics_by_community(_, _info, community_id: int, limit=100, offset=0, by=None):
|
||||
|
|
|
@ -60,7 +60,7 @@ type Query {
|
|||
get_topic(slug: String!): Topic
|
||||
get_topics_all: [Topic]
|
||||
get_topics_by_author(slug: String, user: String, author_id: Int): [Topic]
|
||||
get_topics_by_community(slug: String, community_id: Int): [Topic]
|
||||
get_topics_by_community(community_id: Int!, limit: Int, offset: Int): [Topic]
|
||||
|
||||
# notifier
|
||||
load_notifications(after: Int!, limit: Int, offset: Int): NotificationsResult!
|
||||
|
|
Loading…
Reference in New Issue
Block a user