diff --git a/graphql_parser/lib/src/language/ast/fragment_spread.dart b/graphql_parser/lib/src/language/ast/fragment_spread.dart index dcac0070..36a68383 100644 --- a/graphql_parser/lib/src/language/ast/fragment_spread.dart +++ b/graphql_parser/lib/src/language/ast/fragment_spread.dart @@ -3,17 +3,30 @@ import 'directive.dart'; import 'node.dart'; import 'package:source_span/source_span.dart'; +/// A GraphQL fragment spread. class FragmentSpreadContext extends Node { - final Token ELLIPSIS, NAME; + /// The source tokens. + final Token ellipsisToken, nameToken; + + /// Any directives affixed to this fragment spread. final List directives = []; - FragmentSpreadContext(this.ELLIPSIS, this.NAME); + FragmentSpreadContext(this.ellipsisToken, this.nameToken); - String get name => NAME.text; + /// The [String] value of the [nameToken]. + String get name => nameToken.text; + + /// Use [ellipsisToken] instead. + @deprecated + Token get ELLIPSIS => ellipsisToken; + + /// Use [nameToken] instead. + @deprecated + Token get NAME => nameToken; @override FileSpan get span { - var out = ELLIPSIS.span.expand(NAME.span); + var out = ellipsisToken.span.expand(nameToken.span); if (directives.isEmpty) return out; return directives.fold(out, (o, d) => o.expand(d.span)); }