graphql-go
graphql-go copied to clipboard
Support leading pipe in union definition
The GraphQL spec supports a leading pipe operator for union type definitions, but the parser in graphql-go fails on schemas defined that way.
Notably, in prettier has started using this format in v3, so many GraphQL schemas formatted by prettier will fail when used by this library.
This PR adds support for a leading pipe in union types. I added a unit test. I looked into why this wasn't captured by the validation tests that are generated from graphql-js
, and it seems that this language feature isn't represented in the validation tests.