graphql-go icon indicating copy to clipboard operation
graphql-go copied to clipboard

Support leading pipe in union definition

Open camdencheek opened this issue 4 months ago • 0 comments

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.

camdencheek avatar Oct 19 '24 23:10 camdencheek