From e4d5693ace4edfcd39c5c7ef0f1b0a58c5d05148 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Fri, 3 Aug 2018 23:21:09 -0400 Subject: [PATCH] Fix span expansion when operation name is null --- graphql_parser/lib/src/language/parser.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphql_parser/lib/src/language/parser.dart b/graphql_parser/lib/src/language/parser.dart index 1462aa30..09e18387 100644 --- a/graphql_parser/lib/src/language/parser.dart +++ b/graphql_parser/lib/src/language/parser.dart @@ -66,7 +66,8 @@ class Parser { ..directives.addAll(dirs); else throw new SyntaxError( - 'Expected selection set in fragment definition.', NAME.span); + 'Expected selection set in fragment definition.', + NAME?.span ?? TYPE.span); } else return null; }