from urllib3.util import parse_url
from typing import Tuple
from typing import Optional


def parse_grpc_url(url: str) -> Tuple[Optional[str], str]:
    """
    >>> parse_grpc_url("grpcs://yatai.com:43/query")
    ('grpcs', 'yatai.com:43/query')
    >>> parse_grpc_url("yatai.com:43/query")
    (None, 'yatai.com:43/query')
    """

    parts = parse_url(url)
    return parts.scheme, url.replace(f"{parts.scheme}://", "", 1)