diff --git a/graphql_parser/lib/src/language/ast/argument.dart b/graphql_parser/lib/src/language/ast/argument.dart index 6639874a..f1150bd4 100644 --- a/graphql_parser/lib/src/language/ast/argument.dart +++ b/graphql_parser/lib/src/language/ast/argument.dart @@ -3,18 +3,31 @@ import '../token.dart'; import 'node.dart'; import 'input_value.dart'; +/// An argument passed to a [FieldContext]. class ArgumentContext extends Node { - final Token NAME, COLON; + /// The source tokens. + final Token nameToken, colon; + + /// The value of the argument. final InputValueContext value; - ArgumentContext(this.NAME, this.COLON, this.value); + ArgumentContext(this.nameToken, this.colon, this.value); /// Use [value] instead. @deprecated InputValueContext get valueOrVariable => value; - String get name => NAME.text; + /// Use [nameToken] instead. + @deprecated + Token get NAME => nameToken; + + /// Use [colon] instead. + @deprecated + Token get COLON => colon; + + /// The name of the argument, as a [String]. + String get name => nameToken.text; @override - FileSpan get span => NAME.span.expand(COLON.span).expand(value.span); + FileSpan get span => nameToken.span.expand(colon.span).expand(value.span); }