walmartlabs / lacinia

GraphQL implementation in pure Clojure
http://lacinia.readthedocs.io/en/latest/
Other
1.82k stars 162 forks source link

Support for leading vertical bar in union types #465

Open nullworkbench opened 1 month ago

nullworkbench commented 1 month ago

First of all, I want to express my sincere gratitude to the developers of Lacinia for their hard work to maintaining this project.

Currently, the following notation is supported,

union SomeUnionType =
    TypeA
  | TypeB
  | TypeC

But, writing like below will throw Failed to parse GraphQL schema. exception.

union SomeUnionType =
  | TypeA
  | TypeB
  | TypeC

I would like to request support for leading vertical bar in union types.

This is already supported in the graphql-spec.

Union members may be defined with an optional leading | character to aid formatting when representing a longer list of possible https://github.com/graphql/graphql-spec/blob/main/spec/Section%203%20--%20Type%20System.md#unions

Thank you for your consideration.