8000 Add a method for making GraphQL requests · Issue #12 · jwodder/ghreq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Add a method for making GraphQL requests #12
Open
@jwodder

Description

@jwodder
  • Give Client (but not Endpoint) the following method:

    def graphql(
        self,
        query: str,
        variables: dict[str, Any] | None = None,
        *,
        headers: HeadersType = None,
        timeout: TimeoutType = None,
        raw: bool = False,
    ) -> Any

    This method makes a POST request to f"{api_url}/graphql". Unless a different value (possibly None) is set in headers, the request's headers will include "X-Github-Next-Global-ID: 1".

    • Don't set the X-GitHub-Api-Version header?
    • Don't set the Accept header?
  • graphql() should use (almost?) the same retrying logic as the main API code.

  • graphql() should not insert a mutation delay between POST requests.

  • Use this method in reponews.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request therefor

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0