graphql / express-graphql

Create a GraphQL HTTP server with Express.
MIT License
6.34k stars 538 forks source link

Interoperability with graphql go #767

Closed flovilmart closed 2 years ago

flovilmart commented 3 years ago

GraphQL Go will always default the operation name to an empty string which causes this server to fail serving requests.

The bottom value is expected to be null and not '' in this project.

Would it be acceptable that we change the implementation in this project to allow operationName: '' being interpreted as running the default operation?

The alternatives are:

Would be happy to provide a PR with relevant tests.

acao commented 3 years ago

I think this makes a lot of sense! operationName with an empty string value of '' would just require an additional check for operationName.length > 0, and should be treated as an anonymous operation.

flovilmart commented 3 years ago

Perfect! Let me take some time to fix it up!

flovilmart commented 3 years ago

@acao I opened the above PR; let me know if there’s anything else I can do to help

flovilmart commented 3 years ago

ping @acao ?

IvanGoncharov commented 2 years ago

Closing since it should be resolved in graphql-go, see https://github.com/graphql/express-graphql/pull/768#issuecomment-933028222