2024-10-21 07:52:23 +00:00
|
|
|
from dataclasses import dataclass
|
2025-06-01 23:56:11 +00:00
|
|
|
from typing import Any
|
2024-10-21 07:52:23 +00:00
|
|
|
|
2025-05-29 20:40:27 +00:00
|
|
|
from auth.orm import Author
|
2024-10-21 07:52:23 +00:00
|
|
|
from orm.community import Community
|
2025-06-01 23:56:11 +00:00
|
|
|
from orm.draft import Draft
|
2024-10-21 07:52:23 +00:00
|
|
|
from orm.reaction import Reaction
|
|
|
|
from orm.shout import Shout
|
|
|
|
from orm.topic import Topic
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class CommonResult:
|
2025-06-01 23:56:11 +00:00
|
|
|
"""Общий результат для GraphQL запросов"""
|
|
|
|
|
|
|
|
error: str | None = None
|
|
|
|
drafts: list[Draft] | None = None # Draft objects
|
|
|
|
draft: Draft | None = None # Draft object
|
|
|
|
slugs: list[str] | None = None
|
|
|
|
shout: Shout | None = None
|
|
|
|
shouts: list[Shout] | None = None
|
|
|
|
author: Author | None = None
|
|
|
|
authors: list[Author] | None = None
|
|
|
|
reaction: Reaction | None = None
|
|
|
|
reactions: list[Reaction] | None = None
|
|
|
|
topic: Topic | None = None
|
|
|
|
topics: list[Topic] | None = None
|
|
|
|
community: Community | None = None
|
|
|
|
communities: list[Community] | None = None
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class AuthorFollowsResult:
|
|
|
|
"""Результат для get_author_follows запроса"""
|
|
|
|
|
|
|
|
topics: list[Any] | None = None # Topic dicts
|
|
|
|
authors: list[Any] | None = None # Author dicts
|
|
|
|
communities: list[Any] | None = None # Community dicts
|
|
|
|
error: str | None = None
|