We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1be334e + e7a94e2 commit 47236bfCopy full SHA for 47236bf
spec/Section 3 -- Type System.md
@@ -755,6 +755,28 @@ Union types have the potential to be invalid if incorrectly defined.
755
Similarly, wrapping types may not be member types of a Union.
756
2. A Union type must define one or more unique member types.
757
758
+#### Union type syntax
759
+
760
+Union types are defined by delimiting one or more types with a single vertical bar character `|`:
761
762
+```graphql
763
+union SearchResult = Photo | Person
764
+```
765
766
+You may also use a leading vertical bar:
767
768
769
+union SearchResult =
770
+ | Photo
771
+ | Person
772
773
774
+Trailing delimiters are not supported:
775
776
+```!graphql
777
+union SearchResult = Photo | Person |
778
779
780
### Enums
781
782
GraphQL Enums are a variant on the Scalar type, which represents one of a
0 commit comments