graphql-go / graphql

An implementation of GraphQL for Go / Golang
MIT License
9.86k stars 838 forks source link

Empty OperationName should not be coerced to “” (but null) #616

Open flovilmart opened 2 years ago

flovilmart commented 2 years ago

Hi! We uncovered a compatibility issue with the specification, while calling out express based grapqhQL servers.

The OperationName, when not specified is always coerced to an empty string, which doesn’t appear to be compliant with the specification: https://spec.graphql.org/draft/#sec-Executing-Requests

Initially, I sought to fix the compatibility in the graphQL express implementation, by allowing empty strings as empty operation names through https://github.com/graphql/express-graphql/pull/768.

The maintainers raised that the spec’s requires empty operation names to be conveyed by a null value.

Thanks!