Skip to content

Allow 400 status code if result contain valid graphql error message #40

@koliyo

Description

@koliyo

The graphql server I am using return a HTTP 400 response for invalid requests. So I get both a 400 response, but with proper graphql error data in the body.

Using graphiql or similar I get the graphql error presented, but with gql.client I only get

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: ...

due to

request.raise_for_status()

in https://github.com/graphql-python/gql/blob/master/gql/transport/requests.py#L39

These errors should be returned to the user, not just throw a 400-exception

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions