From cba6d7840d220fd6d7655d5cfffe83aaee6ced4c Mon Sep 17 00:00:00 2001 From: Tobe O Date: Wed, 7 Aug 2019 23:18:14 -0400 Subject: [PATCH] pedantic: type_name --- .../lib/src/language/ast/type_name.dart | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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; }