diff --git a/graphql_parser/lib/src/language/ast/type_name.dart b/graphql_parser/lib/src/language/ast/type_name.dart index d7d9675a..209de19b 100644 --- a/graphql_parser/lib/src/language/ast/type_name.dart +++ b/graphql_parser/lib/src/language/ast/type_name.dart @@ -2,13 +2,20 @@ import 'node.dart'; import 'package:source_span/source_span.dart'; import '../token.dart'; +/// The name of a GraphQL type. class TypeNameContext extends Node { - final Token NAME; + /// The source token. + final Token nameToken; - String get name => NAME.text; + TypeNameContext(this.nameToken); + + /// Use [nameToken] instead. + @deprecated + Token get NAME => nameToken; + + /// The [String] value of the [nameToken]. + String get name => nameToken.text; @override - FileSpan get span => NAME.span; - - TypeNameContext(this.NAME); + FileSpan get span => nameToken.span; }