Home / Function/ get_graphql_response() — fastapi Function Reference

get_graphql_response() — fastapi Function Reference

Architecture documentation for the get_graphql_response() function in notify_translations.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  5de10094_76ff_e44a_c8f3_3063ed26efa2["get_graphql_response()"]
  97ea90ba_5175_e861_5c41_e18772cfce41["notify_translations.py"]
  5de10094_76ff_e44a_c8f3_3063ed26efa2 -->|defined in| 97ea90ba_5175_e861_5c41_e18772cfce41
  db3757db_3aa7_c0de_3404_156cfb8b4378["get_graphql_translation_discussions()"]
  db3757db_3aa7_c0de_3404_156cfb8b4378 -->|calls| 5de10094_76ff_e44a_c8f3_3063ed26efa2
  71af0219_4f30_857a_99f0_add9dc28fee7["get_graphql_translation_discussion_comments_edges()"]
  71af0219_4f30_857a_99f0_add9dc28fee7 -->|calls| 5de10094_76ff_e44a_c8f3_3063ed26efa2
  7b21b141_8eaf_f1b4_7d31_def0d718bfe6["create_comment()"]
  7b21b141_8eaf_f1b4_7d31_def0d718bfe6 -->|calls| 5de10094_76ff_e44a_c8f3_3063ed26efa2
  ab7596ec_b849_0364_85c9_f9c3182b25bd["update_comment()"]
  ab7596ec_b849_0364_85c9_f9c3182b25bd -->|calls| 5de10094_76ff_e44a_c8f3_3063ed26efa2
  style 5de10094_76ff_e44a_c8f3_3063ed26efa2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/notify_translations.py lines 198–236

def get_graphql_response(
    *,
    settings: Settings,
    query: str,
    after: Union[str, None] = None,
    category_id: Union[str, None] = None,
    discussion_number: Union[int, None] = None,
    discussion_id: Union[str, None] = None,
    comment_id: Union[str, None] = None,
    body: Union[str, None] = None,
) -> dict[str, Any]:
    headers = {"Authorization": f"token {settings.github_token.get_secret_value()}"}
    variables = {
        "after": after,
        "category_id": category_id,
        "discussion_number": discussion_number,
        "discussion_id": discussion_id,
        "comment_id": comment_id,
        "body": body,
    }
    response = httpx.post(
        github_graphql_url,
        headers=headers,
        timeout=settings.httpx_timeout,
        json={"query": query, "variables": variables, "operationName": "Q"},
    )
    if response.status_code != 200:
        logging.error(
            f"Response was not 200, after: {after}, category_id: {category_id}"
        )
        logging.error(response.text)
        raise RuntimeError(response.text)
    data = response.json()
    if "errors" in data:
        logging.error(f"Errors in response, after: {after}, category_id: {category_id}")
        logging.error(data["errors"])
        logging.error(response.text)
        raise RuntimeError(response.text)
    return cast(dict[str, Any], data)

Domain

Subdomains

Frequently Asked Questions

What does get_graphql_response() do?
get_graphql_response() is a function in the fastapi codebase, defined in scripts/notify_translations.py.
Where is get_graphql_response() defined?
get_graphql_response() is defined in scripts/notify_translations.py at line 198.
What calls get_graphql_response()?
get_graphql_response() is called by 4 function(s): create_comment, get_graphql_translation_discussion_comments_edges, get_graphql_translation_discussions, update_comment.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free