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; }