@@ -968,10 +968,12 @@ func parseUnionTypeDefinition(lexer: Lexer) throws -> UnionTypeDefinition {
968968 * UnionMembers :
969969 * - NamedType
970970 * - UnionMembers | NamedType
971+ * - | UnionMembers | NamedType
971972 */
972973func parseUnionMembers( lexer: Lexer ) throws -> [ NamedType ] {
973974 var members : [ NamedType ] = [ ]
974975
976+ try expectOptional ( lexer: lexer, kind: . pipe)
975977 repeat {
976978 members. append ( try parseNamedType ( lexer: lexer) )
977979 } while try skip ( lexer: lexer, kind: . pipe)
@@ -1203,6 +1205,7 @@ func parseDirectiveDefinition(lexer: Lexer) throws -> DirectiveDefinition {
12031205 do {
12041206 try expectKeyword ( lexer: lexer, value: " repeatable " )
12051207 try expectKeyword ( lexer: lexer, value: " on " )
1208+ try expectOptional ( lexer: lexer, kind: . pipe)
12061209 let locations = try parseDirectiveLocations ( lexer: lexer)
12071210 return DirectiveDefinition (
12081211 loc: loc ( lexer: lexer, startToken: start) ,
@@ -1214,6 +1217,7 @@ func parseDirectiveDefinition(lexer: Lexer) throws -> DirectiveDefinition {
12141217 )
12151218 } catch {
12161219 try expectKeyword ( lexer: lexer, value: " on " )
1220+ try expectOptional ( lexer: lexer, kind: . pipe)
12171221 let locations = try parseDirectiveLocations ( lexer: lexer)
12181222 return DirectiveDefinition (
12191223 loc: loc ( lexer: lexer, startToken: start) ,
0 commit comments