Skip to content

Add a method for making GraphQL requests #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jwodder opened this issue Apr 13, 2025 · 0 comments
Open

Add a method for making GraphQL requests #12

jwodder opened this issue Apr 13, 2025 · 0 comments
Labels
enhancement New feature or request therefor

Comments

@jwodder
Copy link
Owner

jwodder commented Apr 13, 2025

  • 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.

@jwodder jwodder added the enhancement New feature or request therefor label Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request therefor
Projects
None yet
Development

No branches or pull requests

1 participant