Skip to content

Support leading vertical bar in union types (issue #465)#468

Merged
hlship merged 2 commits intowalmartlabs:masterfrom
juanscasado:feature/union-leading-bar-465
Oct 9, 2025
Merged

Support leading vertical bar in union types (issue #465)#468
hlship merged 2 commits intowalmartlabs:masterfrom
juanscasado:feature/union-leading-bar-465

Conversation

@juanscasado
Copy link

This PR adds support for an optional leading vertical bar (|) in union type definitions in SDL, as specified in the official GraphQL specification.

Highlights:

The SDL parser now accepts union definitions with or without a leading vertical bar.
Added tests to ensure correct parsing of both formats.
Updated documentation (README) to reflect this new feature.
This change improves compatibility with other GraphQL tools and makes it easier to format long union type lists.

Reference: GraphQL Spec - Unions

Closes #465.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@hlship
Copy link
Member

hlship commented Oct 6, 2025

I'm finally getting a chance to look into the backlog of PRs for lacinia --- can you sign the CLA?

@juanscasado
Copy link
Author

Hi! Yes, I’ve already signed the CLA.
Thank you for giving me the opportunity to collaborate!

Copy link
Member

@hlship hlship left a comment

Choose a reason for hiding this comment

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

I was surprised this worked w/o changes to the grammar, but you can see in the grammar that a leading | is expressly allowed.

@hlship hlship added this to the 1.3.0 milestone Oct 9, 2025
@hlship hlship merged commit f369cdd into walmartlabs:master Oct 9, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Support for leading vertical bar in union types

4 participants