Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support leading pipe in union definition #654

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

camdencheek
Copy link
Contributor

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 camdencheek marked this pull request as ready for review October 19, 2024 23:06
Copy link

@eseliger eseliger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@keegancsmith
Copy link
Contributor

cc @pavelnikolov this seems like a straight-forward change. In particular this unblocks anyone who is using prettier v3.

@pavelnikolov pavelnikolov merged commit 4eae033 into graph-gophers:master Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants