Skip to content

GraphQL endpoint throwing HTTP 500 on HTTP GET #583

@sharppanda

Description

@sharppanda

Description

The graphQL server throws an InvalidOperationException("Cannot execute request if no query is specified") when HTTP GET is requested on graphql endpoint.

This is a very common scenario (people opening the graphql endpoint in browser). It is causing an internal server error. It would be better if the GraphQL framework could handle this situation. Instead the error is propagated to ASP.NET middleware.

Steps to reproduce

Open url http://{server}/graphql in browser which points to the graphql endpoint.

Expected result

Bad http request (400)

Actual result

Unhandled exception is thrown.
Returned Http Response 500.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions