from collections.abc import Awaitable
from typing import Callable, Union, Optional, Coroutine, Any

from api_graphql.service.query_context import QueryContext
from service.permission.permissions_enum import Permissions

TRequireAnyPermissions = Optional[list[Permissions]]
TRequireAnyResolvers = list[
    Union[
        Callable[[QueryContext], bool],
        Awaitable[[QueryContext], bool],
        Callable[[QueryContext], Coroutine[Any, Any, bool]],
    ]
]
TRequireAny = tuple[TRequireAnyPermissions, TRequireAnyResolvers]
