From 3d0e70f852ef43bea96f4dd710121361b93868de Mon Sep 17 00:00:00 2001 From: vohoanglong0107 Date: Sat, 13 Jul 2024 07:42:15 +0000 Subject: [PATCH] feat(graphql_parser): separate binding and reference nodes --- .../src/generated/node_factory.rs | 150 +- .../src/generated/syntax_factory.rs | 129 +- .../biome_graphql_formatter/src/generated.rs | 208 ++- .../src/graphql/any/definition.rs | 17 +- .../src/graphql/any/mod.rs | 2 + .../src/graphql/any/primitive_type.rs | 2 +- .../src/graphql/any/type_definition.rs | 21 + .../src/graphql/any/type_extension.rs | 19 + .../src/graphql/any/value.rs | 2 +- .../src/graphql/auxiliary/literal_name.rs | 12 + .../src/graphql/auxiliary/mod.rs | 8 +- .../src/graphql/auxiliary/name.rs | 13 - .../src/graphql/auxiliary/name_binding.rs | 12 + .../src/graphql/auxiliary/name_reference.rs | 16 + .../src/graphql/auxiliary/named_type.rs | 13 - .../src/graphql/auxiliary/variable.rs | 13 - .../src/graphql/auxiliary/variable_binding.rs | 16 + .../graphql/auxiliary/variable_reference.rs | 16 + .../graphql/lists/union_member_type_list.rs | 4 +- .../src/graphql/value/enum_value.rs | 4 +- crates/biome_graphql_parser/src/lexer/mod.rs | 2 +- .../biome_graphql_parser/src/lexer/tests.rs | 16 +- .../src/parser/argument.rs | 5 +- .../src/parser/definitions/directive.rs | 6 +- .../src/parser/definitions/enum.rs | 12 +- .../src/parser/definitions/field.rs | 6 +- .../src/parser/definitions/fragment.rs | 9 +- .../src/parser/definitions/input_object.rs | 8 +- .../src/parser/definitions/interface.rs | 8 +- .../src/parser/definitions/object.rs | 8 +- .../src/parser/definitions/operation.rs | 19 +- .../src/parser/definitions/scalar.rs | 8 +- .../src/parser/definitions/union.rs | 8 +- .../src/parser/directive.rs | 6 +- crates/biome_graphql_parser/src/parser/mod.rs | 33 +- .../biome_graphql_parser/src/parser/type.rs | 11 +- .../biome_graphql_parser/src/parser/value.rs | 13 +- .../src/parser/variable.rs | 21 +- .../directive_definition.graphql.snap | 68 +- .../err/definitions/enum.graphql.snap | 141 +- .../definitions/enum_extension.graphql.snap | 27 +- .../err/definitions/fragment.graphql.snap | 157 +-- .../err/definitions/input_object.graphql.snap | 285 ++-- .../input_object_extension.graphql.snap | 54 +- .../err/definitions/interface.graphql.snap | 542 ++++---- .../interface_extension.graphql.snap | 35 +- .../err/definitions/object.graphql.snap | 542 ++++---- .../definitions/object_extension.graphql.snap | 35 +- .../definitions/scalar_extension.graphql.snap | 8 +- .../err/definitions/schema.graphql.snap | 121 +- .../definitions/schema_extension.graphql.snap | 33 +- .../err/definitions/union.graphql.snap | 160 +-- .../definitions/union_extension.graphql.snap | 38 +- .../err/directive.graphql.snap | 120 +- .../err/operation.graphql.snap | 489 ++++--- .../err/selection_set.graphql.snap | 328 ++--- .../graphql_test_suite/err/type.graphql.snap | 134 +- .../graphql_test_suite/err/value.graphql.snap | 160 +-- .../directive_definition.graphql.snap | 78 +- .../ok/definitions/enum.graphql.snap | 163 +-- .../definitions/enum_extension.graphql.snap | 62 +- .../ok/definitions/fragment.graphql.snap | 126 +- .../ok/definitions/input_object.graphql.snap | 202 ++- .../input_object_extension.graphql.snap | 116 +- .../ok/definitions/interface.graphql.snap | 533 ++++--- .../interface_extension.graphql.snap | 170 +-- .../ok/definitions/object.graphql.snap | 636 ++++----- .../definitions/object_extension.graphql.snap | 170 +-- .../ok/definitions/scalar.graphql.snap | 80 +- .../definitions/scalar_extension.graphql.snap | 16 +- .../ok/definitions/schema.graphql.snap | 99 +- .../definitions/schema_extension.graphql.snap | 93 +- .../ok/definitions/union.graphql.snap | 155 +-- .../definitions/union_extension.graphql.snap | 46 +- .../ok/directive.graphql.snap | 112 +- .../ok/operation.graphql.snap | 320 +++-- .../ok/selection_set.graphql.snap | 615 ++++---- .../graphql_test_suite/ok/type.graphql.snap | 166 +-- .../graphql_test_suite/ok/value.graphql.snap | 144 +- .../src/generated/kind.rs | 10 +- .../src/generated/macros.rs | 20 +- .../src/generated/nodes.rs | 1232 +++++++++++------ .../src/generated/nodes_mut.rs | 90 +- crates/biome_graphql_syntax/src/lib.rs | 1 + xtask/codegen/graphql.ungram | 101 +- xtask/codegen/src/graphql_kind_src.rs | 10 +- 86 files changed, 4988 insertions(+), 4931 deletions(-) create mode 100644 crates/biome_graphql_formatter/src/graphql/any/type_definition.rs create mode 100644 crates/biome_graphql_formatter/src/graphql/any/type_extension.rs create mode 100644 crates/biome_graphql_formatter/src/graphql/auxiliary/literal_name.rs delete mode 100644 crates/biome_graphql_formatter/src/graphql/auxiliary/name.rs create mode 100644 crates/biome_graphql_formatter/src/graphql/auxiliary/name_binding.rs create mode 100644 crates/biome_graphql_formatter/src/graphql/auxiliary/name_reference.rs delete mode 100644 crates/biome_graphql_formatter/src/graphql/auxiliary/named_type.rs delete mode 100644 crates/biome_graphql_formatter/src/graphql/auxiliary/variable.rs create mode 100644 crates/biome_graphql_formatter/src/graphql/auxiliary/variable_binding.rs create mode 100644 crates/biome_graphql_formatter/src/graphql/auxiliary/variable_reference.rs diff --git a/crates/biome_graphql_factory/src/generated/node_factory.rs b/crates/biome_graphql_factory/src/generated/node_factory.rs index cb66f6ed5695..a28de204ef9d 100644 --- a/crates/biome_graphql_factory/src/generated/node_factory.rs +++ b/crates/biome_graphql_factory/src/generated/node_factory.rs @@ -7,7 +7,7 @@ use biome_graphql_syntax::{ GraphqlSyntaxToken as SyntaxToken, *, }; use biome_rowan::AstNode; -pub fn graphql_alias(value: GraphqlName, colon_token: SyntaxToken) -> GraphqlAlias { +pub fn graphql_alias(value: GraphqlLiteralName, colon_token: SyntaxToken) -> GraphqlAlias { GraphqlAlias::unwrap_cast(SyntaxNode::new_detached( GraphqlSyntaxKind::GRAPHQL_ALIAS, [ @@ -17,7 +17,7 @@ pub fn graphql_alias(value: GraphqlName, colon_token: SyntaxToken) -> GraphqlAli )) } pub fn graphql_argument( - name: GraphqlName, + name: GraphqlLiteralName, colon_token: SyntaxToken, value: AnyGraphqlValue, ) -> GraphqlArgument { @@ -81,7 +81,10 @@ pub fn graphql_description(graphql_string_value: GraphqlStringValue) -> GraphqlD ))], )) } -pub fn graphql_directive(at_token: SyntaxToken, name: GraphqlName) -> GraphqlDirectiveBuilder { +pub fn graphql_directive( + at_token: SyntaxToken, + name: GraphqlNameReference, +) -> GraphqlDirectiveBuilder { GraphqlDirectiveBuilder { at_token, name, @@ -90,7 +93,7 @@ pub fn graphql_directive(at_token: SyntaxToken, name: GraphqlName) -> GraphqlDir } pub struct GraphqlDirectiveBuilder { at_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, arguments: Option, } impl GraphqlDirectiveBuilder { @@ -113,7 +116,7 @@ impl GraphqlDirectiveBuilder { pub fn graphql_directive_definition( directive_token: SyntaxToken, at_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, on_token: SyntaxToken, locations: GraphqlDirectiveLocationList, ) -> GraphqlDirectiveDefinitionBuilder { @@ -132,7 +135,7 @@ pub fn graphql_directive_definition( pub struct GraphqlDirectiveDefinitionBuilder { directive_token: SyntaxToken, at_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, on_token: SyntaxToken, locations: GraphqlDirectiveLocationList, description: Option, @@ -186,7 +189,7 @@ pub fn graphql_directive_location(value_token_token: SyntaxToken) -> GraphqlDire } pub fn graphql_enum_type_definition( enum_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, ) -> GraphqlEnumTypeDefinitionBuilder { GraphqlEnumTypeDefinitionBuilder { @@ -199,7 +202,7 @@ pub fn graphql_enum_type_definition( } pub struct GraphqlEnumTypeDefinitionBuilder { enum_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, description: Option, enum_values: Option, @@ -231,7 +234,7 @@ impl GraphqlEnumTypeDefinitionBuilder { pub fn graphql_enum_type_extension( extend_token: SyntaxToken, enum_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, ) -> GraphqlEnumTypeExtensionBuilder { GraphqlEnumTypeExtensionBuilder { @@ -245,7 +248,7 @@ pub fn graphql_enum_type_extension( pub struct GraphqlEnumTypeExtensionBuilder { extend_token: SyntaxToken, enum_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, enum_values: Option, } @@ -268,14 +271,14 @@ impl GraphqlEnumTypeExtensionBuilder { )) } } -pub fn graphql_enum_value(graphql_name: GraphqlName) -> GraphqlEnumValue { +pub fn graphql_enum_value(value: GraphqlLiteralName) -> GraphqlEnumValue { GraphqlEnumValue::unwrap_cast(SyntaxNode::new_detached( GraphqlSyntaxKind::GRAPHQL_ENUM_VALUE, - [Some(SyntaxElement::Node(graphql_name.into_syntax()))], + [Some(SyntaxElement::Node(value.into_syntax()))], )) } pub fn graphql_enum_value_definition( - value: GraphqlEnumValue, + value: GraphqlLiteralName, directives: GraphqlDirectiveList, ) -> GraphqlEnumValueDefinitionBuilder { GraphqlEnumValueDefinitionBuilder { @@ -285,7 +288,7 @@ pub fn graphql_enum_value_definition( } } pub struct GraphqlEnumValueDefinitionBuilder { - value: GraphqlEnumValue, + value: GraphqlLiteralName, directives: GraphqlDirectiveList, description: Option, } @@ -320,7 +323,10 @@ pub fn graphql_enum_values_definition( ], )) } -pub fn graphql_field(name: GraphqlName, directives: GraphqlDirectiveList) -> GraphqlFieldBuilder { +pub fn graphql_field( + name: GraphqlLiteralName, + directives: GraphqlDirectiveList, +) -> GraphqlFieldBuilder { GraphqlFieldBuilder { name, directives, @@ -330,7 +336,7 @@ pub fn graphql_field(name: GraphqlName, directives: GraphqlDirectiveList) -> Gra } } pub struct GraphqlFieldBuilder { - name: GraphqlName, + name: GraphqlLiteralName, directives: GraphqlDirectiveList, alias: Option, arguments: Option, @@ -366,7 +372,7 @@ impl GraphqlFieldBuilder { } } pub fn graphql_field_definition( - name: GraphqlName, + name: GraphqlLiteralName, colon_token: SyntaxToken, ty: AnyGraphqlType, directives: GraphqlDirectiveList, @@ -381,7 +387,7 @@ pub fn graphql_field_definition( } } pub struct GraphqlFieldDefinitionBuilder { - name: GraphqlName, + name: GraphqlLiteralName, colon_token: SyntaxToken, ty: AnyGraphqlType, directives: GraphqlDirectiveList, @@ -435,7 +441,7 @@ pub fn graphql_float_value(graphql_float_literal_token: SyntaxToken) -> GraphqlF } pub fn graphql_fragment_definition( fragment_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, type_condition: GraphqlTypeCondition, directives: GraphqlDirectiveList, selection_set: GraphqlSelectionSet, @@ -453,7 +459,7 @@ pub fn graphql_fragment_definition( } pub fn graphql_fragment_spread( dotdotdot_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, ) -> GraphqlFragmentSpread { GraphqlFragmentSpread::unwrap_cast(SyntaxNode::new_detached( @@ -548,7 +554,7 @@ pub fn graphql_input_fields_definition( } pub fn graphql_input_object_type_definition( input_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, ) -> GraphqlInputObjectTypeDefinitionBuilder { GraphqlInputObjectTypeDefinitionBuilder { @@ -561,7 +567,7 @@ pub fn graphql_input_object_type_definition( } pub struct GraphqlInputObjectTypeDefinitionBuilder { input_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, description: Option, input_fields: Option, @@ -593,7 +599,7 @@ impl GraphqlInputObjectTypeDefinitionBuilder { pub fn graphql_input_object_type_extension( extend_token: SyntaxToken, input_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, ) -> GraphqlInputObjectTypeExtensionBuilder { GraphqlInputObjectTypeExtensionBuilder { @@ -607,7 +613,7 @@ pub fn graphql_input_object_type_extension( pub struct GraphqlInputObjectTypeExtensionBuilder { extend_token: SyntaxToken, input_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, input_fields: Option, } @@ -631,7 +637,7 @@ impl GraphqlInputObjectTypeExtensionBuilder { } } pub fn graphql_input_value_definition( - name: GraphqlName, + name: GraphqlLiteralName, colon_token: SyntaxToken, ty: AnyGraphqlType, directives: GraphqlDirectiveList, @@ -646,7 +652,7 @@ pub fn graphql_input_value_definition( } } pub struct GraphqlInputValueDefinitionBuilder { - name: GraphqlName, + name: GraphqlLiteralName, colon_token: SyntaxToken, ty: AnyGraphqlType, directives: GraphqlDirectiveList, @@ -686,7 +692,7 @@ pub fn graphql_int_value(graphql_int_literal_token: SyntaxToken) -> GraphqlIntVa } pub fn graphql_interface_type_definition( interface_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, ) -> GraphqlInterfaceTypeDefinitionBuilder { GraphqlInterfaceTypeDefinitionBuilder { @@ -700,7 +706,7 @@ pub fn graphql_interface_type_definition( } pub struct GraphqlInterfaceTypeDefinitionBuilder { interface_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, description: Option, implements: Option, @@ -739,7 +745,7 @@ impl GraphqlInterfaceTypeDefinitionBuilder { pub fn graphql_interface_type_extension( extend_token: SyntaxToken, interface_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, ) -> GraphqlInterfaceTypeExtensionBuilder { GraphqlInterfaceTypeExtensionBuilder { @@ -754,7 +760,7 @@ pub fn graphql_interface_type_extension( pub struct GraphqlInterfaceTypeExtensionBuilder { extend_token: SyntaxToken, interface_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, implements: Option, fields: Option, @@ -812,16 +818,22 @@ pub fn graphql_list_value( ], )) } -pub fn graphql_name(value_token: SyntaxToken) -> GraphqlName { - GraphqlName::unwrap_cast(SyntaxNode::new_detached( - GraphqlSyntaxKind::GRAPHQL_NAME, +pub fn graphql_literal_name(value_token: SyntaxToken) -> GraphqlLiteralName { + GraphqlLiteralName::unwrap_cast(SyntaxNode::new_detached( + GraphqlSyntaxKind::GRAPHQL_LITERAL_NAME, [Some(SyntaxElement::Token(value_token))], )) } -pub fn graphql_named_type(name: GraphqlName) -> GraphqlNamedType { - GraphqlNamedType::unwrap_cast(SyntaxNode::new_detached( - GraphqlSyntaxKind::GRAPHQL_NAMED_TYPE, - [Some(SyntaxElement::Node(name.into_syntax()))], +pub fn graphql_name_binding(value_token: SyntaxToken) -> GraphqlNameBinding { + GraphqlNameBinding::unwrap_cast(SyntaxNode::new_detached( + GraphqlSyntaxKind::GRAPHQL_NAME_BINDING, + [Some(SyntaxElement::Token(value_token))], + )) +} +pub fn graphql_name_reference(value_token: SyntaxToken) -> GraphqlNameReference { + GraphqlNameReference::unwrap_cast(SyntaxNode::new_detached( + GraphqlSyntaxKind::GRAPHQL_NAME_REFERENCE, + [Some(SyntaxElement::Token(value_token))], )) } pub fn graphql_non_null_type( @@ -843,7 +855,7 @@ pub fn graphql_null_value(null_token: SyntaxToken) -> GraphqlNullValue { )) } pub fn graphql_object_field( - name: GraphqlName, + name: GraphqlLiteralName, colon_token: SyntaxToken, value: AnyGraphqlValue, ) -> GraphqlObjectField { @@ -858,7 +870,7 @@ pub fn graphql_object_field( } pub fn graphql_object_type_definition( type_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, ) -> GraphqlObjectTypeDefinitionBuilder { GraphqlObjectTypeDefinitionBuilder { @@ -872,7 +884,7 @@ pub fn graphql_object_type_definition( } pub struct GraphqlObjectTypeDefinitionBuilder { type_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, description: Option, implements: Option, @@ -911,7 +923,7 @@ impl GraphqlObjectTypeDefinitionBuilder { pub fn graphql_object_type_extension( extend_token: SyntaxToken, type_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, ) -> GraphqlObjectTypeExtensionBuilder { GraphqlObjectTypeExtensionBuilder { @@ -926,7 +938,7 @@ pub fn graphql_object_type_extension( pub struct GraphqlObjectTypeExtensionBuilder { extend_token: SyntaxToken, type_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, implements: Option, fields: Option, @@ -987,11 +999,11 @@ pub struct GraphqlOperationDefinitionBuilder { ty: GraphqlOperationType, directives: GraphqlDirectiveList, selection_set: GraphqlSelectionSet, - name: Option, + name: Option, variables: Option, } impl GraphqlOperationDefinitionBuilder { - pub fn with_name(mut self, name: GraphqlName) -> Self { + pub fn with_name(mut self, name: GraphqlNameBinding) -> Self { self.name = Some(name); self } @@ -1054,7 +1066,7 @@ impl GraphqlRootBuilder { pub fn graphql_root_operation_type_definition( operation_type: GraphqlOperationType, colon_token: SyntaxToken, - named_type: GraphqlNamedType, + named_type: GraphqlNameReference, ) -> GraphqlRootOperationTypeDefinition { GraphqlRootOperationTypeDefinition::unwrap_cast(SyntaxNode::new_detached( GraphqlSyntaxKind::GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION, @@ -1081,7 +1093,7 @@ pub fn graphql_root_operation_types( } pub fn graphql_scalar_type_definition( scalar_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, ) -> GraphqlScalarTypeDefinitionBuilder { GraphqlScalarTypeDefinitionBuilder { @@ -1093,7 +1105,7 @@ pub fn graphql_scalar_type_definition( } pub struct GraphqlScalarTypeDefinitionBuilder { scalar_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, description: Option, } @@ -1118,7 +1130,7 @@ impl GraphqlScalarTypeDefinitionBuilder { pub fn graphql_scalar_type_extension( extend_token: SyntaxToken, scalar_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, ) -> GraphqlScalarTypeExtension { GraphqlScalarTypeExtension::unwrap_cast(SyntaxNode::new_detached( @@ -1226,7 +1238,10 @@ pub fn graphql_string_value(graphql_string_literal_token: SyntaxToken) -> Graphq [Some(SyntaxElement::Token(graphql_string_literal_token))], )) } -pub fn graphql_type_condition(on_token: SyntaxToken, ty: GraphqlNamedType) -> GraphqlTypeCondition { +pub fn graphql_type_condition( + on_token: SyntaxToken, + ty: GraphqlNameReference, +) -> GraphqlTypeCondition { GraphqlTypeCondition::unwrap_cast(SyntaxNode::new_detached( GraphqlSyntaxKind::GRAPHQL_TYPE_CONDITION, [ @@ -1269,7 +1284,7 @@ impl GraphqlUnionMemberTypesBuilder { } pub fn graphql_union_type_definition( union_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, ) -> GraphqlUnionTypeDefinitionBuilder { GraphqlUnionTypeDefinitionBuilder { @@ -1282,7 +1297,7 @@ pub fn graphql_union_type_definition( } pub struct GraphqlUnionTypeDefinitionBuilder { union_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameBinding, directives: GraphqlDirectiveList, description: Option, union_members: Option, @@ -1314,7 +1329,7 @@ impl GraphqlUnionTypeDefinitionBuilder { pub fn graphql_union_type_extension( extend_token: SyntaxToken, union_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, ) -> GraphqlUnionTypeExtensionBuilder { GraphqlUnionTypeExtensionBuilder { @@ -1328,7 +1343,7 @@ pub fn graphql_union_type_extension( pub struct GraphqlUnionTypeExtensionBuilder { extend_token: SyntaxToken, union_token: SyntaxToken, - name: GraphqlName, + name: GraphqlNameReference, directives: GraphqlDirectiveList, union_members: Option, } @@ -1351,9 +1366,12 @@ impl GraphqlUnionTypeExtensionBuilder { )) } } -pub fn graphql_variable(dollar_token: SyntaxToken, name: GraphqlName) -> GraphqlVariable { - GraphqlVariable::unwrap_cast(SyntaxNode::new_detached( - GraphqlSyntaxKind::GRAPHQL_VARIABLE, +pub fn graphql_variable_binding( + dollar_token: SyntaxToken, + name: GraphqlLiteralName, +) -> GraphqlVariableBinding { + GraphqlVariableBinding::unwrap_cast(SyntaxNode::new_detached( + GraphqlSyntaxKind::GRAPHQL_VARIABLE_BINDING, [ Some(SyntaxElement::Token(dollar_token)), Some(SyntaxElement::Node(name.into_syntax())), @@ -1361,7 +1379,7 @@ pub fn graphql_variable(dollar_token: SyntaxToken, name: GraphqlName) -> Graphql )) } pub fn graphql_variable_definition( - variable: GraphqlVariable, + variable: GraphqlVariableBinding, colon_token: SyntaxToken, ty: AnyGraphqlType, directives: GraphqlDirectiveList, @@ -1375,7 +1393,7 @@ pub fn graphql_variable_definition( } } pub struct GraphqlVariableDefinitionBuilder { - variable: GraphqlVariable, + variable: GraphqlVariableBinding, colon_token: SyntaxToken, ty: AnyGraphqlType, directives: GraphqlDirectiveList, @@ -1414,6 +1432,18 @@ pub fn graphql_variable_definitions( ], )) } +pub fn graphql_variable_reference( + dollar_token: SyntaxToken, + name: GraphqlLiteralName, +) -> GraphqlVariableReference { + GraphqlVariableReference::unwrap_cast(SyntaxNode::new_detached( + GraphqlSyntaxKind::GRAPHQL_VARIABLE_REFERENCE, + [ + Some(SyntaxElement::Token(dollar_token)), + Some(SyntaxElement::Node(name.into_syntax())), + ], + )) +} pub fn graphql_argument_definition_list(items: I) -> GraphqlArgumentDefinitionList where I: IntoIterator, @@ -1515,7 +1545,7 @@ pub fn graphql_implements_interface_list( separators: S, ) -> GraphqlImplementsInterfaceList where - I: IntoIterator, + I: IntoIterator, I::IntoIter: ExactSizeIterator, S: IntoIterator, S::IntoIter: ExactSizeIterator, @@ -1598,7 +1628,7 @@ where } pub fn graphql_union_member_type_list(items: I, separators: S) -> GraphqlUnionMemberTypeList where - I: IntoIterator, + I: IntoIterator, I::IntoIter: ExactSizeIterator, S: IntoIterator, S::IntoIter: ExactSizeIterator, diff --git a/crates/biome_graphql_factory/src/generated/syntax_factory.rs b/crates/biome_graphql_factory/src/generated/syntax_factory.rs index c697214720cf..7d424108da4e 100644 --- a/crates/biome_graphql_factory/src/generated/syntax_factory.rs +++ b/crates/biome_graphql_factory/src/generated/syntax_factory.rs @@ -24,7 +24,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { let mut slots: RawNodeSlots<2usize> = RawNodeSlots::default(); let mut current_element = elements.next(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlLiteralName::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -50,7 +50,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { let mut slots: RawNodeSlots<3usize> = RawNodeSlots::default(); let mut current_element = elements.next(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlLiteralName::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -220,7 +220,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameReference::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -267,7 +267,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameBinding::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -375,7 +375,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameBinding::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -422,7 +422,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameReference::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -455,7 +455,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { let mut slots: RawNodeSlots<1usize> = RawNodeSlots::default(); let mut current_element = elements.next(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlLiteralName::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -481,7 +481,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlEnumValue::can_cast(element.kind()) { + if GraphqlLiteralName::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -547,7 +547,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlLiteralName::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -594,7 +594,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlLiteralName::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -700,7 +700,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameBinding::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -747,7 +747,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameReference::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -893,7 +893,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameBinding::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -940,7 +940,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameReference::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -980,7 +980,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlLiteralName::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1060,7 +1060,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameBinding::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1114,7 +1114,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameReference::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1215,12 +1215,12 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.into_node(GRAPHQL_LIST_VALUE, children) } - GRAPHQL_NAME => { + GRAPHQL_LITERAL_NAME => { let mut elements = (&children).into_iter(); let mut slots: RawNodeSlots<1usize> = RawNodeSlots::default(); let mut current_element = elements.next(); if let Some(element) = ¤t_element { - if element.kind() == GRAPHQL_NAME { + if element.kind() == IDENT { slots.mark_present(); current_element = elements.next(); } @@ -1228,18 +1228,18 @@ impl SyntaxFactory for GraphqlSyntaxFactory { slots.next_slot(); if current_element.is_some() { return RawSyntaxNode::new( - GRAPHQL_NAME.to_bogus(), + GRAPHQL_LITERAL_NAME.to_bogus(), children.into_iter().map(Some), ); } - slots.into_node(GRAPHQL_NAME, children) + slots.into_node(GRAPHQL_LITERAL_NAME, children) } - GRAPHQL_NAMED_TYPE => { + GRAPHQL_NAME_BINDING => { let mut elements = (&children).into_iter(); let mut slots: RawNodeSlots<1usize> = RawNodeSlots::default(); let mut current_element = elements.next(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if element.kind() == IDENT { slots.mark_present(); current_element = elements.next(); } @@ -1247,11 +1247,30 @@ impl SyntaxFactory for GraphqlSyntaxFactory { slots.next_slot(); if current_element.is_some() { return RawSyntaxNode::new( - GRAPHQL_NAMED_TYPE.to_bogus(), + GRAPHQL_NAME_BINDING.to_bogus(), children.into_iter().map(Some), ); } - slots.into_node(GRAPHQL_NAMED_TYPE, children) + slots.into_node(GRAPHQL_NAME_BINDING, children) + } + GRAPHQL_NAME_REFERENCE => { + let mut elements = (&children).into_iter(); + let mut slots: RawNodeSlots<1usize> = RawNodeSlots::default(); + let mut current_element = elements.next(); + if let Some(element) = ¤t_element { + if element.kind() == IDENT { + slots.mark_present(); + current_element = elements.next(); + } + } + slots.next_slot(); + if current_element.is_some() { + return RawSyntaxNode::new( + GRAPHQL_NAME_REFERENCE.to_bogus(), + children.into_iter().map(Some), + ); + } + slots.into_node(GRAPHQL_NAME_REFERENCE, children) } GRAPHQL_NON_NULL_TYPE => { let mut elements = (&children).into_iter(); @@ -1303,7 +1322,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { let mut slots: RawNodeSlots<3usize> = RawNodeSlots::default(); let mut current_element = elements.next(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlLiteralName::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1350,7 +1369,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameBinding::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1404,7 +1423,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameReference::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1484,7 +1503,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameBinding::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1590,7 +1609,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlNamedType::can_cast(element.kind()) { + if GraphqlNameReference::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1656,7 +1675,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameBinding::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1696,7 +1715,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameReference::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1861,7 +1880,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlNamedType::can_cast(element.kind()) { + if GraphqlNameReference::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1927,7 +1946,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameBinding::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1974,7 +1993,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlNameReference::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -2002,7 +2021,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.into_node(GRAPHQL_UNION_TYPE_EXTENSION, children) } - GRAPHQL_VARIABLE => { + GRAPHQL_VARIABLE_BINDING => { let mut elements = (&children).into_iter(); let mut slots: RawNodeSlots<2usize> = RawNodeSlots::default(); let mut current_element = elements.next(); @@ -2014,7 +2033,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if GraphqlName::can_cast(element.kind()) { + if GraphqlLiteralName::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -2022,18 +2041,18 @@ impl SyntaxFactory for GraphqlSyntaxFactory { slots.next_slot(); if current_element.is_some() { return RawSyntaxNode::new( - GRAPHQL_VARIABLE.to_bogus(), + GRAPHQL_VARIABLE_BINDING.to_bogus(), children.into_iter().map(Some), ); } - slots.into_node(GRAPHQL_VARIABLE, children) + slots.into_node(GRAPHQL_VARIABLE_BINDING, children) } GRAPHQL_VARIABLE_DEFINITION => { let mut elements = (&children).into_iter(); let mut slots: RawNodeSlots<5usize> = RawNodeSlots::default(); let mut current_element = elements.next(); if let Some(element) = ¤t_element { - if GraphqlVariable::can_cast(element.kind()) { + if GraphqlVariableBinding::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -2108,6 +2127,32 @@ impl SyntaxFactory for GraphqlSyntaxFactory { } slots.into_node(GRAPHQL_VARIABLE_DEFINITIONS, children) } + GRAPHQL_VARIABLE_REFERENCE => { + let mut elements = (&children).into_iter(); + let mut slots: RawNodeSlots<2usize> = RawNodeSlots::default(); + let mut current_element = elements.next(); + if let Some(element) = ¤t_element { + if element.kind() == T ! [$] { + slots.mark_present(); + current_element = elements.next(); + } + } + slots.next_slot(); + if let Some(element) = ¤t_element { + if GraphqlLiteralName::can_cast(element.kind()) { + slots.mark_present(); + current_element = elements.next(); + } + } + slots.next_slot(); + if current_element.is_some() { + return RawSyntaxNode::new( + GRAPHQL_VARIABLE_REFERENCE.to_bogus(), + children.into_iter().map(Some), + ); + } + slots.into_node(GRAPHQL_VARIABLE_REFERENCE, children) + } GRAPHQL_ARGUMENT_DEFINITION_LIST => { Self::make_node_list_syntax(kind, children, GraphqlInputValueDefinition::can_cast) } @@ -2136,7 +2181,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { GRAPHQL_IMPLEMENTS_INTERFACE_LIST => Self::make_separated_list_syntax( kind, children, - GraphqlNamedType::can_cast, + GraphqlNameReference::can_cast, T ! [&], false, ), @@ -2160,7 +2205,7 @@ impl SyntaxFactory for GraphqlSyntaxFactory { GRAPHQL_UNION_MEMBER_TYPE_LIST => Self::make_separated_list_syntax( kind, children, - GraphqlNamedType::can_cast, + GraphqlNameReference::can_cast, T ! [|], false, ), diff --git a/crates/biome_graphql_formatter/src/generated.rs b/crates/biome_graphql_formatter/src/generated.rs index ddc4e9d20ffb..034d0351d39f 100644 --- a/crates/biome_graphql_formatter/src/generated.rs +++ b/crates/biome_graphql_formatter/src/generated.rs @@ -1160,83 +1160,123 @@ impl IntoFormat for biome_graphql_syntax::GraphqlListValue ) } } -impl FormatRule - for crate::graphql::auxiliary::name::FormatGraphqlName +impl FormatRule + for crate::graphql::auxiliary::literal_name::FormatGraphqlLiteralName { type Context = GraphqlFormatContext; #[inline(always)] fn fmt( &self, - node: &biome_graphql_syntax::GraphqlName, + node: &biome_graphql_syntax::GraphqlLiteralName, f: &mut GraphqlFormatter, ) -> FormatResult<()> { - FormatNodeRule::::fmt(self, node, f) + FormatNodeRule::::fmt(self, node, f) } } -impl AsFormat for biome_graphql_syntax::GraphqlName { +impl AsFormat for biome_graphql_syntax::GraphqlLiteralName { type Format<'a> = FormatRefWithRule< 'a, - biome_graphql_syntax::GraphqlName, - crate::graphql::auxiliary::name::FormatGraphqlName, + biome_graphql_syntax::GraphqlLiteralName, + crate::graphql::auxiliary::literal_name::FormatGraphqlLiteralName, >; fn format(&self) -> Self::Format<'_> { #![allow(clippy::default_constructed_unit_structs)] FormatRefWithRule::new( self, - crate::graphql::auxiliary::name::FormatGraphqlName::default(), + crate::graphql::auxiliary::literal_name::FormatGraphqlLiteralName::default(), ) } } -impl IntoFormat for biome_graphql_syntax::GraphqlName { +impl IntoFormat for biome_graphql_syntax::GraphqlLiteralName { type Format = FormatOwnedWithRule< - biome_graphql_syntax::GraphqlName, - crate::graphql::auxiliary::name::FormatGraphqlName, + biome_graphql_syntax::GraphqlLiteralName, + crate::graphql::auxiliary::literal_name::FormatGraphqlLiteralName, >; fn into_format(self) -> Self::Format { #![allow(clippy::default_constructed_unit_structs)] FormatOwnedWithRule::new( self, - crate::graphql::auxiliary::name::FormatGraphqlName::default(), + crate::graphql::auxiliary::literal_name::FormatGraphqlLiteralName::default(), ) } } -impl FormatRule - for crate::graphql::auxiliary::named_type::FormatGraphqlNamedType +impl FormatRule + for crate::graphql::auxiliary::name_binding::FormatGraphqlNameBinding { type Context = GraphqlFormatContext; #[inline(always)] fn fmt( &self, - node: &biome_graphql_syntax::GraphqlNamedType, + node: &biome_graphql_syntax::GraphqlNameBinding, f: &mut GraphqlFormatter, ) -> FormatResult<()> { - FormatNodeRule::::fmt(self, node, f) + FormatNodeRule::::fmt(self, node, f) } } -impl AsFormat for biome_graphql_syntax::GraphqlNamedType { +impl AsFormat for biome_graphql_syntax::GraphqlNameBinding { type Format<'a> = FormatRefWithRule< 'a, - biome_graphql_syntax::GraphqlNamedType, - crate::graphql::auxiliary::named_type::FormatGraphqlNamedType, + biome_graphql_syntax::GraphqlNameBinding, + crate::graphql::auxiliary::name_binding::FormatGraphqlNameBinding, >; fn format(&self) -> Self::Format<'_> { #![allow(clippy::default_constructed_unit_structs)] FormatRefWithRule::new( self, - crate::graphql::auxiliary::named_type::FormatGraphqlNamedType::default(), + crate::graphql::auxiliary::name_binding::FormatGraphqlNameBinding::default(), ) } } -impl IntoFormat for biome_graphql_syntax::GraphqlNamedType { +impl IntoFormat for biome_graphql_syntax::GraphqlNameBinding { type Format = FormatOwnedWithRule< - biome_graphql_syntax::GraphqlNamedType, - crate::graphql::auxiliary::named_type::FormatGraphqlNamedType, + biome_graphql_syntax::GraphqlNameBinding, + crate::graphql::auxiliary::name_binding::FormatGraphqlNameBinding, >; fn into_format(self) -> Self::Format { #![allow(clippy::default_constructed_unit_structs)] FormatOwnedWithRule::new( self, - crate::graphql::auxiliary::named_type::FormatGraphqlNamedType::default(), + crate::graphql::auxiliary::name_binding::FormatGraphqlNameBinding::default(), + ) + } +} +impl FormatRule + for crate::graphql::auxiliary::name_reference::FormatGraphqlNameReference +{ + type Context = GraphqlFormatContext; + #[inline(always)] + fn fmt( + &self, + node: &biome_graphql_syntax::GraphqlNameReference, + f: &mut GraphqlFormatter, + ) -> FormatResult<()> { + FormatNodeRule::::fmt(self, node, f) + } +} +impl AsFormat for biome_graphql_syntax::GraphqlNameReference { + type Format<'a> = FormatRefWithRule< + 'a, + biome_graphql_syntax::GraphqlNameReference, + crate::graphql::auxiliary::name_reference::FormatGraphqlNameReference, + >; + fn format(&self) -> Self::Format<'_> { + #![allow(clippy::default_constructed_unit_structs)] + FormatRefWithRule::new( + self, + crate::graphql::auxiliary::name_reference::FormatGraphqlNameReference::default(), + ) + } +} +impl IntoFormat for biome_graphql_syntax::GraphqlNameReference { + type Format = FormatOwnedWithRule< + biome_graphql_syntax::GraphqlNameReference, + crate::graphql::auxiliary::name_reference::FormatGraphqlNameReference, + >; + fn into_format(self) -> Self::Format { + #![allow(clippy::default_constructed_unit_structs)] + FormatOwnedWithRule::new( + self, + crate::graphql::auxiliary::name_reference::FormatGraphqlNameReference::default(), ) } } @@ -2009,43 +2049,43 @@ impl IntoFormat for biome_graphql_syntax::GraphqlUnionType FormatOwnedWithRule :: new (self , crate :: graphql :: extensions :: union_type_extension :: FormatGraphqlUnionTypeExtension :: default ()) } } -impl FormatRule - for crate::graphql::auxiliary::variable::FormatGraphqlVariable +impl FormatRule + for crate::graphql::auxiliary::variable_binding::FormatGraphqlVariableBinding { type Context = GraphqlFormatContext; #[inline(always)] fn fmt( &self, - node: &biome_graphql_syntax::GraphqlVariable, + node: &biome_graphql_syntax::GraphqlVariableBinding, f: &mut GraphqlFormatter, ) -> FormatResult<()> { - FormatNodeRule::::fmt(self, node, f) + FormatNodeRule::::fmt(self, node, f) } } -impl AsFormat for biome_graphql_syntax::GraphqlVariable { +impl AsFormat for biome_graphql_syntax::GraphqlVariableBinding { type Format<'a> = FormatRefWithRule< 'a, - biome_graphql_syntax::GraphqlVariable, - crate::graphql::auxiliary::variable::FormatGraphqlVariable, + biome_graphql_syntax::GraphqlVariableBinding, + crate::graphql::auxiliary::variable_binding::FormatGraphqlVariableBinding, >; fn format(&self) -> Self::Format<'_> { #![allow(clippy::default_constructed_unit_structs)] FormatRefWithRule::new( self, - crate::graphql::auxiliary::variable::FormatGraphqlVariable::default(), + crate::graphql::auxiliary::variable_binding::FormatGraphqlVariableBinding::default(), ) } } -impl IntoFormat for biome_graphql_syntax::GraphqlVariable { +impl IntoFormat for biome_graphql_syntax::GraphqlVariableBinding { type Format = FormatOwnedWithRule< - biome_graphql_syntax::GraphqlVariable, - crate::graphql::auxiliary::variable::FormatGraphqlVariable, + biome_graphql_syntax::GraphqlVariableBinding, + crate::graphql::auxiliary::variable_binding::FormatGraphqlVariableBinding, >; fn into_format(self) -> Self::Format { #![allow(clippy::default_constructed_unit_structs)] FormatOwnedWithRule::new( self, - crate::graphql::auxiliary::variable::FormatGraphqlVariable::default(), + crate::graphql::auxiliary::variable_binding::FormatGraphqlVariableBinding::default(), ) } } @@ -2117,6 +2157,48 @@ impl IntoFormat for biome_graphql_syntax::GraphqlVariableD FormatOwnedWithRule :: new (self , crate :: graphql :: auxiliary :: variable_definitions :: FormatGraphqlVariableDefinitions :: default ()) } } +impl FormatRule + for crate::graphql::auxiliary::variable_reference::FormatGraphqlVariableReference +{ + type Context = GraphqlFormatContext; + #[inline(always)] + fn fmt( + &self, + node: &biome_graphql_syntax::GraphqlVariableReference, + f: &mut GraphqlFormatter, + ) -> FormatResult<()> { + FormatNodeRule::::fmt(self, node, f) + } +} +impl AsFormat for biome_graphql_syntax::GraphqlVariableReference { + type Format<'a> = FormatRefWithRule< + 'a, + biome_graphql_syntax::GraphqlVariableReference, + crate::graphql::auxiliary::variable_reference::FormatGraphqlVariableReference, + >; + fn format(&self) -> Self::Format<'_> { + #![allow(clippy::default_constructed_unit_structs)] + FormatRefWithRule::new( + self, + crate::graphql::auxiliary::variable_reference::FormatGraphqlVariableReference::default( + ), + ) + } +} +impl IntoFormat for biome_graphql_syntax::GraphqlVariableReference { + type Format = FormatOwnedWithRule< + biome_graphql_syntax::GraphqlVariableReference, + crate::graphql::auxiliary::variable_reference::FormatGraphqlVariableReference, + >; + fn into_format(self) -> Self::Format { + #![allow(clippy::default_constructed_unit_structs)] + FormatOwnedWithRule::new( + self, + crate::graphql::auxiliary::variable_reference::FormatGraphqlVariableReference::default( + ), + ) + } +} impl AsFormat for biome_graphql_syntax::GraphqlArgumentDefinitionList { type Format<'a> = FormatRefWithRule< 'a, @@ -2810,6 +2892,60 @@ impl IntoFormat for biome_graphql_syntax::AnyGraphqlType { ) } } +impl AsFormat for biome_graphql_syntax::AnyGraphqlTypeDefinition { + type Format<'a> = FormatRefWithRule< + 'a, + biome_graphql_syntax::AnyGraphqlTypeDefinition, + crate::graphql::any::type_definition::FormatAnyGraphqlTypeDefinition, + >; + fn format(&self) -> Self::Format<'_> { + #![allow(clippy::default_constructed_unit_structs)] + FormatRefWithRule::new( + self, + crate::graphql::any::type_definition::FormatAnyGraphqlTypeDefinition::default(), + ) + } +} +impl IntoFormat for biome_graphql_syntax::AnyGraphqlTypeDefinition { + type Format = FormatOwnedWithRule< + biome_graphql_syntax::AnyGraphqlTypeDefinition, + crate::graphql::any::type_definition::FormatAnyGraphqlTypeDefinition, + >; + fn into_format(self) -> Self::Format { + #![allow(clippy::default_constructed_unit_structs)] + FormatOwnedWithRule::new( + self, + crate::graphql::any::type_definition::FormatAnyGraphqlTypeDefinition::default(), + ) + } +} +impl AsFormat for biome_graphql_syntax::AnyGraphqlTypeExtension { + type Format<'a> = FormatRefWithRule< + 'a, + biome_graphql_syntax::AnyGraphqlTypeExtension, + crate::graphql::any::type_extension::FormatAnyGraphqlTypeExtension, + >; + fn format(&self) -> Self::Format<'_> { + #![allow(clippy::default_constructed_unit_structs)] + FormatRefWithRule::new( + self, + crate::graphql::any::type_extension::FormatAnyGraphqlTypeExtension::default(), + ) + } +} +impl IntoFormat for biome_graphql_syntax::AnyGraphqlTypeExtension { + type Format = FormatOwnedWithRule< + biome_graphql_syntax::AnyGraphqlTypeExtension, + crate::graphql::any::type_extension::FormatAnyGraphqlTypeExtension, + >; + fn into_format(self) -> Self::Format { + #![allow(clippy::default_constructed_unit_structs)] + FormatOwnedWithRule::new( + self, + crate::graphql::any::type_extension::FormatAnyGraphqlTypeExtension::default(), + ) + } +} impl AsFormat for biome_graphql_syntax::AnyGraphqlValue { type Format<'a> = FormatRefWithRule< 'a, diff --git a/crates/biome_graphql_formatter/src/graphql/any/definition.rs b/crates/biome_graphql_formatter/src/graphql/any/definition.rs index afe18112b588..fe755cbe6950 100644 --- a/crates/biome_graphql_formatter/src/graphql/any/definition.rs +++ b/crates/biome_graphql_formatter/src/graphql/any/definition.rs @@ -8,24 +8,15 @@ impl FormatRule for FormatAnyGraphqlDefinition { type Context = GraphqlFormatContext; fn fmt(&self, node: &AnyGraphqlDefinition, f: &mut GraphqlFormatter) -> FormatResult<()> { match node { - AnyGraphqlDefinition::AnyGraphqlOperationDefinition(node) => node.format().fmt(f), + AnyGraphqlDefinition::AnyGraphqlTypeDefinition(node) => node.format().fmt(f), + AnyGraphqlDefinition::AnyGraphqlTypeExtension(node) => node.format().fmt(f), AnyGraphqlDefinition::GraphqlBogusDefinition(node) => node.format().fmt(f), AnyGraphqlDefinition::GraphqlDirectiveDefinition(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlEnumTypeDefinition(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlEnumTypeExtension(node) => node.format().fmt(f), AnyGraphqlDefinition::GraphqlFragmentDefinition(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlInputObjectTypeDefinition(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlInputObjectTypeExtension(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlInterfaceTypeDefinition(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlInterfaceTypeExtension(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlObjectTypeDefinition(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlObjectTypeExtension(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlScalarTypeDefinition(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlScalarTypeExtension(node) => node.format().fmt(f), + AnyGraphqlDefinition::GraphqlOperationDefinition(node) => node.format().fmt(f), AnyGraphqlDefinition::GraphqlSchemaDefinition(node) => node.format().fmt(f), AnyGraphqlDefinition::GraphqlSchemaExtension(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlUnionTypeDefinition(node) => node.format().fmt(f), - AnyGraphqlDefinition::GraphqlUnionTypeExtension(node) => node.format().fmt(f), + AnyGraphqlDefinition::GraphqlSelectionSet(node) => node.format().fmt(f), } } } diff --git a/crates/biome_graphql_formatter/src/graphql/any/mod.rs b/crates/biome_graphql_formatter/src/graphql/any/mod.rs index 8091277781ff..8dbafdfb63c4 100644 --- a/crates/biome_graphql_formatter/src/graphql/any/mod.rs +++ b/crates/biome_graphql_formatter/src/graphql/any/mod.rs @@ -5,4 +5,6 @@ pub(crate) mod operation_definition; pub(crate) mod primitive_type; pub(crate) mod selection; pub(crate) mod ts_type; +pub(crate) mod type_definition; +pub(crate) mod type_extension; pub(crate) mod value; diff --git a/crates/biome_graphql_formatter/src/graphql/any/primitive_type.rs b/crates/biome_graphql_formatter/src/graphql/any/primitive_type.rs index b3fe02ea20b4..713da647ea28 100644 --- a/crates/biome_graphql_formatter/src/graphql/any/primitive_type.rs +++ b/crates/biome_graphql_formatter/src/graphql/any/primitive_type.rs @@ -9,7 +9,7 @@ impl FormatRule for FormatAnyGraphqlPrimitiveType { fn fmt(&self, node: &AnyGraphqlPrimitiveType, f: &mut GraphqlFormatter) -> FormatResult<()> { match node { AnyGraphqlPrimitiveType::GraphqlListType(node) => node.format().fmt(f), - AnyGraphqlPrimitiveType::GraphqlNamedType(node) => node.format().fmt(f), + AnyGraphqlPrimitiveType::GraphqlNameReference(node) => node.format().fmt(f), } } } diff --git a/crates/biome_graphql_formatter/src/graphql/any/type_definition.rs b/crates/biome_graphql_formatter/src/graphql/any/type_definition.rs new file mode 100644 index 000000000000..d5b0dbdcef7c --- /dev/null +++ b/crates/biome_graphql_formatter/src/graphql/any/type_definition.rs @@ -0,0 +1,21 @@ +//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file. + +use crate::prelude::*; +use biome_graphql_syntax::AnyGraphqlTypeDefinition; +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatAnyGraphqlTypeDefinition; +impl FormatRule for FormatAnyGraphqlTypeDefinition { + type Context = GraphqlFormatContext; + fn fmt(&self, node: &AnyGraphqlTypeDefinition, f: &mut GraphqlFormatter) -> FormatResult<()> { + match node { + AnyGraphqlTypeDefinition::GraphqlEnumTypeDefinition(node) => node.format().fmt(f), + AnyGraphqlTypeDefinition::GraphqlInputObjectTypeDefinition(node) => { + node.format().fmt(f) + } + AnyGraphqlTypeDefinition::GraphqlInterfaceTypeDefinition(node) => node.format().fmt(f), + AnyGraphqlTypeDefinition::GraphqlObjectTypeDefinition(node) => node.format().fmt(f), + AnyGraphqlTypeDefinition::GraphqlScalarTypeDefinition(node) => node.format().fmt(f), + AnyGraphqlTypeDefinition::GraphqlUnionTypeDefinition(node) => node.format().fmt(f), + } + } +} diff --git a/crates/biome_graphql_formatter/src/graphql/any/type_extension.rs b/crates/biome_graphql_formatter/src/graphql/any/type_extension.rs new file mode 100644 index 000000000000..242c6f772b8a --- /dev/null +++ b/crates/biome_graphql_formatter/src/graphql/any/type_extension.rs @@ -0,0 +1,19 @@ +//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file. + +use crate::prelude::*; +use biome_graphql_syntax::AnyGraphqlTypeExtension; +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatAnyGraphqlTypeExtension; +impl FormatRule for FormatAnyGraphqlTypeExtension { + type Context = GraphqlFormatContext; + fn fmt(&self, node: &AnyGraphqlTypeExtension, f: &mut GraphqlFormatter) -> FormatResult<()> { + match node { + AnyGraphqlTypeExtension::GraphqlEnumTypeExtension(node) => node.format().fmt(f), + AnyGraphqlTypeExtension::GraphqlInputObjectTypeExtension(node) => node.format().fmt(f), + AnyGraphqlTypeExtension::GraphqlInterfaceTypeExtension(node) => node.format().fmt(f), + AnyGraphqlTypeExtension::GraphqlObjectTypeExtension(node) => node.format().fmt(f), + AnyGraphqlTypeExtension::GraphqlScalarTypeExtension(node) => node.format().fmt(f), + AnyGraphqlTypeExtension::GraphqlUnionTypeExtension(node) => node.format().fmt(f), + } + } +} diff --git a/crates/biome_graphql_formatter/src/graphql/any/value.rs b/crates/biome_graphql_formatter/src/graphql/any/value.rs index f4ec2bf3bb71..c0894930b101 100644 --- a/crates/biome_graphql_formatter/src/graphql/any/value.rs +++ b/crates/biome_graphql_formatter/src/graphql/any/value.rs @@ -17,7 +17,7 @@ impl FormatRule for FormatAnyGraphqlValue { AnyGraphqlValue::GraphqlNullValue(node) => node.format().fmt(f), AnyGraphqlValue::GraphqlObjectValue(node) => node.format().fmt(f), AnyGraphqlValue::GraphqlStringValue(node) => node.format().fmt(f), - AnyGraphqlValue::GraphqlVariable(node) => node.format().fmt(f), + AnyGraphqlValue::GraphqlVariableReference(node) => node.format().fmt(f), } } } diff --git a/crates/biome_graphql_formatter/src/graphql/auxiliary/literal_name.rs b/crates/biome_graphql_formatter/src/graphql/auxiliary/literal_name.rs new file mode 100644 index 000000000000..3f6ba450aea0 --- /dev/null +++ b/crates/biome_graphql_formatter/src/graphql/auxiliary/literal_name.rs @@ -0,0 +1,12 @@ +use crate::prelude::*; +use biome_formatter::write; +use biome_graphql_syntax::{GraphqlLiteralName, GraphqlLiteralNameFields}; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatGraphqlLiteralName; +impl FormatNodeRule for FormatGraphqlLiteralName { + fn fmt_fields(&self, node: &GraphqlLiteralName, f: &mut GraphqlFormatter) -> FormatResult<()> { + let GraphqlLiteralNameFields { value_token } = node.as_fields(); + write!(f, [value_token.format()]) + } +} diff --git a/crates/biome_graphql_formatter/src/graphql/auxiliary/mod.rs b/crates/biome_graphql_formatter/src/graphql/auxiliary/mod.rs index 7d676ff180a4..fbccecf53a51 100644 --- a/crates/biome_graphql_formatter/src/graphql/auxiliary/mod.rs +++ b/crates/biome_graphql_formatter/src/graphql/auxiliary/mod.rs @@ -11,8 +11,9 @@ pub(crate) mod fragment_spread; pub(crate) mod implements_interfaces; pub(crate) mod inline_fragment; pub(crate) mod list_type; -pub(crate) mod name; -pub(crate) mod named_type; +pub(crate) mod literal_name; +pub(crate) mod name_binding; +pub(crate) mod name_reference; pub(crate) mod non_null_type; pub(crate) mod object_field; pub(crate) mod operation_type; @@ -21,5 +22,6 @@ pub(crate) mod root_operation_types; pub(crate) mod selection_set; pub(crate) mod type_condition; pub(crate) mod union_member_types; -pub(crate) mod variable; +pub(crate) mod variable_binding; pub(crate) mod variable_definitions; +pub(crate) mod variable_reference; diff --git a/crates/biome_graphql_formatter/src/graphql/auxiliary/name.rs b/crates/biome_graphql_formatter/src/graphql/auxiliary/name.rs deleted file mode 100644 index f217dbcca876..000000000000 --- a/crates/biome_graphql_formatter/src/graphql/auxiliary/name.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::prelude::*; -use biome_formatter::write; -use biome_graphql_syntax::{GraphqlName, GraphqlNameFields}; - -#[derive(Debug, Clone, Default)] -pub(crate) struct FormatGraphqlName; -impl FormatNodeRule for FormatGraphqlName { - fn fmt_fields(&self, node: &GraphqlName, f: &mut GraphqlFormatter) -> FormatResult<()> { - let GraphqlNameFields { value_token } = node.as_fields(); - - write![f, [value_token.format()]] - } -} diff --git a/crates/biome_graphql_formatter/src/graphql/auxiliary/name_binding.rs b/crates/biome_graphql_formatter/src/graphql/auxiliary/name_binding.rs new file mode 100644 index 000000000000..7459faeff9d9 --- /dev/null +++ b/crates/biome_graphql_formatter/src/graphql/auxiliary/name_binding.rs @@ -0,0 +1,12 @@ +use crate::prelude::*; +use biome_formatter::write; +use biome_graphql_syntax::{GraphqlNameBinding, GraphqlNameBindingFields}; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatGraphqlNameBinding; +impl FormatNodeRule for FormatGraphqlNameBinding { + fn fmt_fields(&self, node: &GraphqlNameBinding, f: &mut GraphqlFormatter) -> FormatResult<()> { + let GraphqlNameBindingFields { value_token } = node.as_fields(); + write!(f, [value_token.format()]) + } +} diff --git a/crates/biome_graphql_formatter/src/graphql/auxiliary/name_reference.rs b/crates/biome_graphql_formatter/src/graphql/auxiliary/name_reference.rs new file mode 100644 index 000000000000..6fe583f4d699 --- /dev/null +++ b/crates/biome_graphql_formatter/src/graphql/auxiliary/name_reference.rs @@ -0,0 +1,16 @@ +use crate::prelude::*; +use biome_formatter::write; +use biome_graphql_syntax::{GraphqlNameReference, GraphqlNameReferenceFields}; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatGraphqlNameReference; +impl FormatNodeRule for FormatGraphqlNameReference { + fn fmt_fields( + &self, + node: &GraphqlNameReference, + f: &mut GraphqlFormatter, + ) -> FormatResult<()> { + let GraphqlNameReferenceFields { value_token } = node.as_fields(); + write!(f, [value_token.format()]) + } +} diff --git a/crates/biome_graphql_formatter/src/graphql/auxiliary/named_type.rs b/crates/biome_graphql_formatter/src/graphql/auxiliary/named_type.rs deleted file mode 100644 index a88658d49356..000000000000 --- a/crates/biome_graphql_formatter/src/graphql/auxiliary/named_type.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::prelude::*; -use biome_formatter::write; -use biome_graphql_syntax::{GraphqlNamedType, GraphqlNamedTypeFields}; - -#[derive(Debug, Clone, Default)] -pub(crate) struct FormatGraphqlNamedType; -impl FormatNodeRule for FormatGraphqlNamedType { - fn fmt_fields(&self, node: &GraphqlNamedType, f: &mut GraphqlFormatter) -> FormatResult<()> { - let GraphqlNamedTypeFields { name } = node.as_fields(); - - write!(f, [name.format()]) - } -} diff --git a/crates/biome_graphql_formatter/src/graphql/auxiliary/variable.rs b/crates/biome_graphql_formatter/src/graphql/auxiliary/variable.rs deleted file mode 100644 index f196332807da..000000000000 --- a/crates/biome_graphql_formatter/src/graphql/auxiliary/variable.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::prelude::*; -use biome_formatter::write; -use biome_graphql_syntax::{GraphqlVariable, GraphqlVariableFields}; - -#[derive(Debug, Clone, Default)] -pub(crate) struct FormatGraphqlVariable; -impl FormatNodeRule for FormatGraphqlVariable { - fn fmt_fields(&self, node: &GraphqlVariable, f: &mut GraphqlFormatter) -> FormatResult<()> { - let GraphqlVariableFields { dollar_token, name } = node.as_fields(); - - write![f, [dollar_token.format(), name.format(),]] - } -} diff --git a/crates/biome_graphql_formatter/src/graphql/auxiliary/variable_binding.rs b/crates/biome_graphql_formatter/src/graphql/auxiliary/variable_binding.rs new file mode 100644 index 000000000000..7532ac736c11 --- /dev/null +++ b/crates/biome_graphql_formatter/src/graphql/auxiliary/variable_binding.rs @@ -0,0 +1,16 @@ +use crate::prelude::*; +use biome_formatter::write; +use biome_graphql_syntax::{GraphqlVariableBinding, GraphqlVariableBindingFields}; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatGraphqlVariableBinding; +impl FormatNodeRule for FormatGraphqlVariableBinding { + fn fmt_fields( + &self, + node: &GraphqlVariableBinding, + f: &mut GraphqlFormatter, + ) -> FormatResult<()> { + let GraphqlVariableBindingFields { dollar_token, name } = node.as_fields(); + write!(f, [dollar_token.format(), name.format()]) + } +} diff --git a/crates/biome_graphql_formatter/src/graphql/auxiliary/variable_reference.rs b/crates/biome_graphql_formatter/src/graphql/auxiliary/variable_reference.rs new file mode 100644 index 000000000000..475e212e5a0c --- /dev/null +++ b/crates/biome_graphql_formatter/src/graphql/auxiliary/variable_reference.rs @@ -0,0 +1,16 @@ +use crate::prelude::*; +use biome_formatter::write; +use biome_graphql_syntax::{GraphqlVariableReference, GraphqlVariableReferenceFields}; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatGraphqlVariableReference; +impl FormatNodeRule for FormatGraphqlVariableReference { + fn fmt_fields( + &self, + node: &GraphqlVariableReference, + f: &mut GraphqlFormatter, + ) -> FormatResult<()> { + let GraphqlVariableReferenceFields { dollar_token, name } = node.as_fields(); + write!(f, [dollar_token.format(), name.format()]) + } +} diff --git a/crates/biome_graphql_formatter/src/graphql/lists/union_member_type_list.rs b/crates/biome_graphql_formatter/src/graphql/lists/union_member_type_list.rs index 826bf48f96b9..53bf885e7868 100644 --- a/crates/biome_graphql_formatter/src/graphql/lists/union_member_type_list.rs +++ b/crates/biome_graphql_formatter/src/graphql/lists/union_member_type_list.rs @@ -1,6 +1,6 @@ use crate::prelude::*; use biome_formatter::write; -use biome_graphql_syntax::{GraphqlLanguage, GraphqlNamedType, GraphqlUnionMemberTypeList}; +use biome_graphql_syntax::{GraphqlLanguage, GraphqlNameReference, GraphqlUnionMemberTypeList}; use biome_rowan::AstSeparatedElement; #[derive(Debug, Clone, Default)] @@ -25,7 +25,7 @@ impl FormatRule for FormatGraphqlUnionMemberTypeList pub struct FormatTypeVariant { last: bool, - element: AstSeparatedElement, + element: AstSeparatedElement, } impl Format for FormatTypeVariant { diff --git a/crates/biome_graphql_formatter/src/graphql/value/enum_value.rs b/crates/biome_graphql_formatter/src/graphql/value/enum_value.rs index 316ac2d56b1a..9b39a240d0d6 100644 --- a/crates/biome_graphql_formatter/src/graphql/value/enum_value.rs +++ b/crates/biome_graphql_formatter/src/graphql/value/enum_value.rs @@ -5,8 +5,8 @@ use biome_graphql_syntax::{GraphqlEnumValue, GraphqlEnumValueFields}; pub(crate) struct FormatGraphqlEnumValue; impl FormatNodeRule for FormatGraphqlEnumValue { fn fmt_fields(&self, node: &GraphqlEnumValue, f: &mut GraphqlFormatter) -> FormatResult<()> { - let GraphqlEnumValueFields { graphql_name } = node.as_fields(); + let GraphqlEnumValueFields { value } = node.as_fields(); - write!(f, [graphql_name.format()]) + write!(f, [value.format()]) } } diff --git a/crates/biome_graphql_parser/src/lexer/mod.rs b/crates/biome_graphql_parser/src/lexer/mod.rs index d6389e1b19b1..079639e93080 100644 --- a/crates/biome_graphql_parser/src/lexer/mod.rs +++ b/crates/biome_graphql_parser/src/lexer/mod.rs @@ -302,7 +302,7 @@ impl<'src> GraphqlLexer<'src> { b"ENUM_VALUE" => ENUM_VALUE_KW, b"INPUT_OBJECT" => INPUT_OBJECT_KW, b"INPUT_FIELD_DEFINITION" => INPUT_FIELD_DEFINITION_KW, - _ => GRAPHQL_NAME, + _ => T![ident], } } diff --git a/crates/biome_graphql_parser/src/lexer/tests.rs b/crates/biome_graphql_parser/src/lexer/tests.rs index 6e05ea9e3f86..5c356b756bdb 100644 --- a/crates/biome_graphql_parser/src/lexer/tests.rs +++ b/crates/biome_graphql_parser/src/lexer/tests.rs @@ -85,11 +85,7 @@ fn losslessness(string: String) -> bool { }); let token_ranges = receiver .recv_timeout(Duration::from_secs(2)) - .unwrap_or_else(|_| { - panic!( - "Lexer is infinitely recursing with this code: ->{string}<-" - ) - }); + .unwrap_or_else(|_| panic!("Lexer is infinitely recursing with this code: ->{string}<-")); let mut new_str = String::with_capacity(string.len()); let mut idx = TextSize::from(0); @@ -310,31 +306,31 @@ fn comment() { fn name() { assert_lex! { r#"asciiIdentifier"#, - GRAPHQL_NAME:15, + IDENT:15, } assert_lex! { r#"with_underscore_here"#, - GRAPHQL_NAME:20, + IDENT:20, } assert_lex! { r#"with_unicodeà"#, - GRAPHQL_NAME:12, + IDENT:12, ERROR_TOKEN:2, } assert_lex! { r#"ᨀwith_unicodeàç"#, ERROR_TOKEN:3, - GRAPHQL_NAME:12, + IDENT:12, ERROR_TOKEN:2, ERROR_TOKEN:2, } assert_lex! { r#"field }"#, - GRAPHQL_NAME:5, + IDENT:5, WHITESPACE:1, R_CURLY:1, } diff --git a/crates/biome_graphql_parser/src/parser/argument.rs b/crates/biome_graphql_parser/src/parser/argument.rs index eb98e9e11265..cd194c677197 100644 --- a/crates/biome_graphql_parser/src/parser/argument.rs +++ b/crates/biome_graphql_parser/src/parser/argument.rs @@ -1,4 +1,3 @@ -use crate::parser::{parse_name, GraphqlParser}; use biome_graphql_syntax::{ GraphqlSyntaxKind::{self, *}, T, @@ -12,7 +11,9 @@ use super::{ directive::is_at_directive, is_nth_at_name, parse_error::{expected_argument, expected_value}, + parse_literal_name, value::parse_value, + GraphqlParser, }; struct ArgumentListParseRecovery; @@ -76,7 +77,7 @@ fn parse_argument(p: &mut GraphqlParser) -> ParsedSyntax { let m = p.start(); // name is checked for in `is_at_name` - parse_name(p).ok(); + parse_literal_name(p).ok(); p.expect(T![:]); parse_value(p).or_add_diagnostic(p, expected_value); diff --git a/crates/biome_graphql_parser/src/parser/definitions/directive.rs b/crates/biome_graphql_parser/src/parser/definitions/directive.rs index d1681e7dda6f..54bfac66fe98 100644 --- a/crates/biome_graphql_parser/src/parser/definitions/directive.rs +++ b/crates/biome_graphql_parser/src/parser/definitions/directive.rs @@ -1,7 +1,7 @@ use crate::parser::{ - parse_description, + parse_binding, parse_description, parse_error::{expected_directive_location, expected_name}, - parse_name, GraphqlParser, + GraphqlParser, }; use biome_graphql_syntax::{ GraphqlSyntaxKind::{self, *}, @@ -46,7 +46,7 @@ pub(crate) fn parse_directive_definition(p: &mut GraphqlParser) -> ParsedSyntax p.bump(T![directive]); p.expect(T![@]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_binding(p).or_add_diagnostic(p, expected_name); // arguments are optional parse_arguments_definition(p).ok(); diff --git a/crates/biome_graphql_parser/src/parser/definitions/enum.rs b/crates/biome_graphql_parser/src/parser/definitions/enum.rs index d67aee5b28c0..954c0e4c1830 100644 --- a/crates/biome_graphql_parser/src/parser/definitions/enum.rs +++ b/crates/biome_graphql_parser/src/parser/definitions/enum.rs @@ -1,9 +1,9 @@ use crate::parser::{ directive::{is_at_directive, DirectiveList}, - is_nth_at_name, is_nth_at_non_kw_name, parse_description, + is_nth_at_name, is_nth_at_non_kw_name, parse_binding, parse_description, parse_error::{expected_enum_extension, expected_name}, - parse_name, - value::{is_at_string, parse_enum_value}, + parse_literal_name, parse_reference, + value::is_at_string, GraphqlParser, }; use biome_graphql_syntax::{ @@ -24,7 +24,7 @@ pub(crate) fn parse_enum_type_definition(p: &mut GraphqlParser) -> ParsedSyntax p.bump(T![enum]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_binding(p).or_add_diagnostic(p, expected_name); DirectiveList.parse_list(p); @@ -42,7 +42,7 @@ pub(crate) fn parse_enum_type_extension(p: &mut GraphqlParser) -> ParsedSyntax { p.bump(T![extend]); p.expect(T![enum]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_reference(p).or_add_diagnostic(p, expected_name); let directive_list = DirectiveList.parse_list(p); let directive_empty = directive_list.range(p).is_empty(); @@ -118,7 +118,7 @@ pub(crate) fn parse_enum_value_definition(p: &mut GraphqlParser) -> ParsedSyntax // description is optional parse_description(p).ok(); - parse_enum_value(p).or_add_diagnostic(p, expected_name); + parse_literal_name(p).or_add_diagnostic(p, expected_name); DirectiveList.parse_list(p); diff --git a/crates/biome_graphql_parser/src/parser/definitions/field.rs b/crates/biome_graphql_parser/src/parser/definitions/field.rs index e7d84e57b763..e9eb496797c0 100644 --- a/crates/biome_graphql_parser/src/parser/definitions/field.rs +++ b/crates/biome_graphql_parser/src/parser/definitions/field.rs @@ -2,7 +2,7 @@ use crate::parser::{ directive::DirectiveList, is_nth_at_name, is_nth_at_non_kw_name, parse_description, parse_error::{expected_field_definition, expected_name, expected_type}, - parse_name, + parse_literal_name, r#type::parse_type, value::{is_at_string, parse_default_value}, GraphqlParser, @@ -81,7 +81,7 @@ fn parse_field_definition(p: &mut GraphqlParser) -> ParsedSyntax { // description is optional parse_description(p).ok(); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_literal_name(p).or_add_diagnostic(p, expected_name); // arguments are optional parse_arguments_definition(p).ok(); @@ -157,7 +157,7 @@ pub(super) fn parse_input_value_definition(p: &mut GraphqlParser) -> ParsedSynta // description is optional parse_description(p).ok(); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_literal_name(p).or_add_diagnostic(p, expected_name); p.expect(T![:]); diff --git a/crates/biome_graphql_parser/src/parser/definitions/fragment.rs b/crates/biome_graphql_parser/src/parser/definitions/fragment.rs index a11f494288a6..516252c2b374 100644 --- a/crates/biome_graphql_parser/src/parser/definitions/fragment.rs +++ b/crates/biome_graphql_parser/src/parser/definitions/fragment.rs @@ -1,9 +1,8 @@ use crate::parser::{ directive::DirectiveList, + parse_binding, parse_error::{expected_name, expected_named_type, fragment_name_must_not_be_on}, - parse_name, - r#type::parse_named_type, - GraphqlParser, + parse_reference, GraphqlParser, }; use biome_graphql_syntax::{GraphqlSyntaxKind::*, T}; use biome_parser::{ @@ -21,7 +20,7 @@ pub(crate) fn parse_fragment_definition(p: &mut GraphqlParser) -> ParsedSyntax { if p.at(T![on]) { p.error(fragment_name_must_not_be_on(p, p.cur_range())); } - parse_name(p).or_add_diagnostic(p, expected_name); + parse_binding(p).or_add_diagnostic(p, expected_name); parse_type_condition(p); DirectiveList.parse_list(p); @@ -34,7 +33,7 @@ pub(crate) fn parse_fragment_definition(p: &mut GraphqlParser) -> ParsedSyntax { pub(crate) fn parse_type_condition(p: &mut GraphqlParser) -> CompletedMarker { let m = p.start(); p.expect(T![on]); - parse_named_type(p).or_add_diagnostic(p, expected_named_type); + parse_reference(p).or_add_diagnostic(p, expected_named_type); m.complete(p, GRAPHQL_TYPE_CONDITION) } diff --git a/crates/biome_graphql_parser/src/parser/definitions/input_object.rs b/crates/biome_graphql_parser/src/parser/definitions/input_object.rs index 1987415e776f..576465832ad2 100644 --- a/crates/biome_graphql_parser/src/parser/definitions/input_object.rs +++ b/crates/biome_graphql_parser/src/parser/definitions/input_object.rs @@ -1,8 +1,8 @@ use crate::parser::{ directive::DirectiveList, - parse_description, + parse_binding, parse_description, parse_error::{expected_input_object_extension, expected_name}, - parse_name, GraphqlParser, + parse_reference, GraphqlParser, }; use biome_graphql_syntax::{ GraphqlSyntaxKind::{self, *}, @@ -24,7 +24,7 @@ pub(crate) fn parse_input_object_type_definition(p: &mut GraphqlParser) -> Parse p.bump(T![input]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_binding(p).or_add_diagnostic(p, expected_name); DirectiveList.parse_list(p); @@ -42,7 +42,7 @@ pub(crate) fn parse_input_object_type_extension(p: &mut GraphqlParser) -> Parsed p.bump(T![extend]); p.expect(T![input]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_reference(p).or_add_diagnostic(p, expected_name); let directive_list = DirectiveList.parse_list(p); let directive_empty = directive_list.range(p).is_empty(); diff --git a/crates/biome_graphql_parser/src/parser/definitions/interface.rs b/crates/biome_graphql_parser/src/parser/definitions/interface.rs index 1b50916b5949..ac4f168a7dad 100644 --- a/crates/biome_graphql_parser/src/parser/definitions/interface.rs +++ b/crates/biome_graphql_parser/src/parser/definitions/interface.rs @@ -1,8 +1,8 @@ use crate::parser::{ directive::{is_at_directive, DirectiveList}, - is_nth_at_name, parse_description, + is_nth_at_name, parse_binding, parse_description, parse_error::{expected_name, expected_named_type, expected_object_extension}, - parse_name, + parse_reference, r#type::parse_named_type, GraphqlParser, }; @@ -32,7 +32,7 @@ pub(super) fn parse_interface_type_definition(p: &mut GraphqlParser) -> ParsedSy p.bump(T![interface]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_binding(p).or_add_diagnostic(p, expected_name); // implements interface is optional parse_implements_interface(p).ok(); @@ -53,7 +53,7 @@ pub(super) fn parse_interface_type_extension(p: &mut GraphqlParser) -> ParsedSyn p.bump(T![extend]); p.bump(T![interface]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_reference(p).or_add_diagnostic(p, expected_name); let implements_interface_empty = parse_implements_interface(p).is_absent(); diff --git a/crates/biome_graphql_parser/src/parser/definitions/object.rs b/crates/biome_graphql_parser/src/parser/definitions/object.rs index 77a180324e65..5a5dbd212fb0 100644 --- a/crates/biome_graphql_parser/src/parser/definitions/object.rs +++ b/crates/biome_graphql_parser/src/parser/definitions/object.rs @@ -1,8 +1,8 @@ use crate::parser::{ directive::DirectiveList, - parse_description, + parse_binding, parse_description, parse_error::{expected_name, expected_object_extension}, - parse_name, GraphqlParser, + parse_reference, GraphqlParser, }; use biome_graphql_syntax::{GraphqlSyntaxKind::*, T}; use biome_parser::{ @@ -21,7 +21,7 @@ pub(crate) fn parse_object_type_definition(p: &mut GraphqlParser) -> ParsedSynta p.bump(T![type]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_binding(p).or_add_diagnostic(p, expected_name); // implements interface is optional parse_implements_interface(p).ok(); @@ -41,7 +41,7 @@ pub(crate) fn parse_object_type_extension(p: &mut GraphqlParser) -> ParsedSyntax p.bump(T![extend]); p.bump(T![type]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_reference(p).or_add_diagnostic(p, expected_name); let implements_interface_empty = parse_implements_interface(p).is_absent(); diff --git a/crates/biome_graphql_parser/src/parser/definitions/operation.rs b/crates/biome_graphql_parser/src/parser/definitions/operation.rs index 4c3a8f236f05..2b34fa783845 100644 --- a/crates/biome_graphql_parser/src/parser/definitions/operation.rs +++ b/crates/biome_graphql_parser/src/parser/definitions/operation.rs @@ -1,15 +1,15 @@ use crate::parser::{ argument::parse_arguments, directive::{is_at_directive, DirectiveList}, - is_nth_at_name, + is_nth_at_name, parse_binding, parse_error::{ expected_any_selection, expected_name, expected_type, expected_variable, expected_variable_definition, }, - parse_name, + parse_literal_name, parse_reference, r#type::parse_type, value::parse_default_value, - variable::{is_at_variable, parse_variable}, + variable::{is_at_variable, parse_variable_binding}, GraphqlParser, }; use biome_graphql_syntax::{ @@ -117,7 +117,7 @@ pub(crate) fn parse_operation_definition(p: &mut GraphqlParser) -> ParsedSyntax } // we don't need diagnostic here, because name is optional - parse_name(p).ok(); + parse_binding(p).ok(); // we don't need diagnostic here, because variable definitions are optional parse_variable_definitions(p).ok(); @@ -161,7 +161,8 @@ fn parse_field(p: &mut GraphqlParser) -> ParsedSyntax { if p.at(T![:]) { p.error(expected_name(p, p.cur_range())); } else if is_nth_at_name(p, 0) { - parse_name(p).ok(); + // parse alias + parse_literal_name(p).ok(); } else { p.error(expected_name(p, p.cur_range())); p.bump_any(); @@ -170,9 +171,9 @@ fn parse_field(p: &mut GraphqlParser) -> ParsedSyntax { p.bump(T![:]); m.complete(p, GRAPHQL_ALIAS); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_literal_name(p).or_add_diagnostic(p, expected_name); } else { - parse_name(p).or_add_diagnostic(p, expected_name); + parse_literal_name(p).or_add_diagnostic(p, expected_name); } // arguments are optional @@ -194,7 +195,7 @@ fn parse_fragment(p: &mut GraphqlParser) -> ParsedSyntax { p.expect(DOT3); if is_nth_at_name(p, 0) && !p.nth_at(0, T![on]) { // name is checked for in `is_at_name` - parse_name(p).ok(); + parse_reference(p).ok(); DirectiveList.parse_list(p); Present(m.complete(p, GRAPHQL_FRAGMENT_SPREAD)) } else { @@ -235,7 +236,7 @@ fn parse_variable_definition(p: &mut GraphqlParser) -> ParsedSyntax { p.error(expected_variable(p, p.cur_range())); p.bump_any() } else { - parse_variable(p).or_add_diagnostic(p, expected_variable); + parse_variable_binding(p).or_add_diagnostic(p, expected_variable); } p.expect(T![:]); parse_type(p).or_add_diagnostic(p, expected_type); diff --git a/crates/biome_graphql_parser/src/parser/definitions/scalar.rs b/crates/biome_graphql_parser/src/parser/definitions/scalar.rs index 0b6b51a3af73..26a7b3eb240d 100644 --- a/crates/biome_graphql_parser/src/parser/definitions/scalar.rs +++ b/crates/biome_graphql_parser/src/parser/definitions/scalar.rs @@ -1,8 +1,8 @@ use crate::parser::{ directive::DirectiveList, - parse_description, + parse_binding, parse_description, parse_error::{expected_directive, expected_name}, - parse_name, GraphqlParser, + parse_reference, GraphqlParser, }; use biome_graphql_syntax::{GraphqlSyntaxKind::*, T}; use biome_parser::{ @@ -18,7 +18,7 @@ pub(crate) fn parse_scalar_type_definition(p: &mut GraphqlParser) -> ParsedSynta p.bump(T![scalar]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_binding(p).or_add_diagnostic(p, expected_name); DirectiveList.parse_list(p); Present(m.complete(p, GRAPHQL_SCALAR_TYPE_DEFINITION)) @@ -32,7 +32,7 @@ pub(crate) fn parse_scalar_type_extension(p: &mut GraphqlParser) -> ParsedSyntax p.bump(T![extend]); p.bump(T![scalar]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_reference(p).or_add_diagnostic(p, expected_name); let pos = p.source().position(); DirectiveList.parse_list(p); let directive_empty = p.source().position() == pos; diff --git a/crates/biome_graphql_parser/src/parser/definitions/union.rs b/crates/biome_graphql_parser/src/parser/definitions/union.rs index 088ecbc56b06..340a1a42e10c 100644 --- a/crates/biome_graphql_parser/src/parser/definitions/union.rs +++ b/crates/biome_graphql_parser/src/parser/definitions/union.rs @@ -1,8 +1,8 @@ use crate::parser::{ directive::DirectiveList, - is_nth_at_name, is_nth_at_non_kw_name, parse_description, + is_nth_at_name, is_nth_at_non_kw_name, parse_binding, parse_description, parse_error::{expected_name, expected_named_type, expected_union_extension}, - parse_name, + parse_reference, r#type::parse_named_type, GraphqlParser, }; @@ -29,7 +29,7 @@ pub(crate) fn parse_union_type_definition(p: &mut GraphqlParser) -> ParsedSyntax p.bump(T![union]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_binding(p).or_add_diagnostic(p, expected_name); DirectiveList.parse_list(p); @@ -47,7 +47,7 @@ pub(super) fn parse_union_type_extension(p: &mut GraphqlParser) -> ParsedSyntax p.bump(T![extend]); p.bump(T![union]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_reference(p).or_add_diagnostic(p, expected_name); let directive_list = DirectiveList.parse_list(p); let directive_empty = directive_list.range(p).is_empty(); diff --git a/crates/biome_graphql_parser/src/parser/directive.rs b/crates/biome_graphql_parser/src/parser/directive.rs index 289df07c4b9b..52f8605e7975 100644 --- a/crates/biome_graphql_parser/src/parser/directive.rs +++ b/crates/biome_graphql_parser/src/parser/directive.rs @@ -1,4 +1,4 @@ -use crate::parser::{parse_error::expected_name, parse_name, GraphqlParser}; +use crate::parser::{parse_error::expected_name, GraphqlParser}; use biome_graphql_syntax::{ GraphqlSyntaxKind::{self, *}, T, @@ -8,7 +8,7 @@ use biome_parser::{ prelude::ParsedSyntax::*, Parser, }; -use super::{argument::parse_arguments, parse_error::expected_directive}; +use super::{argument::parse_arguments, parse_error::expected_directive, parse_reference}; struct DirectiveListParseRecovery; impl ParseRecovery for DirectiveListParseRecovery { @@ -55,7 +55,7 @@ pub(crate) fn parse_directive(p: &mut GraphqlParser) -> ParsedSyntax { let m = p.start(); p.bump(T![@]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_reference(p).or_add_diagnostic(p, expected_name); // arguments are optional parse_arguments(p).ok(); diff --git a/crates/biome_graphql_parser/src/parser/mod.rs b/crates/biome_graphql_parser/src/parser/mod.rs index a3d314ce7ff3..dc821520c522 100644 --- a/crates/biome_graphql_parser/src/parser/mod.rs +++ b/crates/biome_graphql_parser/src/parser/mod.rs @@ -7,6 +7,7 @@ mod value; mod variable; use crate::token_source::GraphqlTokenSource; use biome_graphql_syntax::GraphqlSyntaxKind::{self, *}; +use biome_graphql_syntax::T; use biome_parser::diagnostic::merge_diagnostics; use biome_parser::event::Event; use biome_parser::parse_lists::ParseNodeList; @@ -19,7 +20,7 @@ use self::value::{is_at_string, parse_string}; /// Graphql allow keywords to be used as names const GRAPHQL_POTENTIAL_NAME_SET: TokenSet = token_set![ - GRAPHQL_NAME, + T![ident], TRUE_KW, FALSE_KW, QUERY_KW, @@ -123,14 +124,36 @@ pub(crate) fn parse_root(p: &mut GraphqlParser) -> CompletedMarker { } #[inline] -fn parse_name(p: &mut GraphqlParser) -> ParsedSyntax { +fn parse_literal_name(p: &mut GraphqlParser) -> ParsedSyntax { if !is_nth_at_name(p, 0) { return Absent; } let m = p.start(); - p.bump_remap(GRAPHQL_NAME); - Present(m.complete(p, GRAPHQL_NAME)) + p.bump_remap(T![ident]); + Present(m.complete(p, GRAPHQL_LITERAL_NAME)) +} + +#[inline] +fn parse_binding(p: &mut GraphqlParser) -> ParsedSyntax { + if !is_nth_at_name(p, 0) { + return Absent; + } + + let m = p.start(); + p.bump_remap(T![ident]); + Present(m.complete(p, GRAPHQL_NAME_BINDING)) +} + +#[inline] +fn parse_reference(p: &mut GraphqlParser) -> ParsedSyntax { + if !is_nth_at_name(p, 0) { + return Absent; + } + + let m = p.start(); + p.bump_remap(T![ident]); + Present(m.complete(p, GRAPHQL_NAME_REFERENCE)) } #[inline] @@ -153,5 +176,5 @@ fn is_nth_at_name(p: &mut GraphqlParser, n: usize) -> bool { #[inline] fn is_nth_at_non_kw_name(p: &mut GraphqlParser, n: usize) -> bool { - p.nth_at(n, GRAPHQL_NAME) + p.nth_at(n, T![ident]) } diff --git a/crates/biome_graphql_parser/src/parser/type.rs b/crates/biome_graphql_parser/src/parser/type.rs index e71fd8e2ca28..0a6bd2e92b26 100644 --- a/crates/biome_graphql_parser/src/parser/type.rs +++ b/crates/biome_graphql_parser/src/parser/type.rs @@ -1,12 +1,11 @@ -use crate::parser::{parse_name, GraphqlParser}; use biome_graphql_syntax::{GraphqlSyntaxKind::*, T}; use biome_parser::{ parsed_syntax::ParsedSyntax, prelude::ParsedSyntax::*, CompletedMarker, Parser, }; use super::{ - is_nth_at_name, parse_error::{expected_named_or_list_type, expected_type}, + parse_reference, GraphqlParser, }; #[inline] @@ -42,13 +41,7 @@ fn parse_list_type(p: &mut GraphqlParser) -> CompletedMarker { #[inline] pub(crate) fn parse_named_type(p: &mut GraphqlParser) -> ParsedSyntax { - if !is_nth_at_name(p, 0) { - return Absent; - } - let m = p.start(); - parse_name(p).ok(); - - Present(m.complete(p, GRAPHQL_NAMED_TYPE)) + parse_reference(p) } #[inline] diff --git a/crates/biome_graphql_parser/src/parser/value.rs b/crates/biome_graphql_parser/src/parser/value.rs index 6c60400f1287..213638f7733e 100644 --- a/crates/biome_graphql_parser/src/parser/value.rs +++ b/crates/biome_graphql_parser/src/parser/value.rs @@ -1,6 +1,6 @@ /// Parse all inpul value /// https://spec.graphql.org/October2021/#sec-Input-Values -use crate::parser::{parse_name, GraphqlParser}; +use crate::parser::GraphqlParser; use biome_graphql_syntax::{ GraphqlSyntaxKind::{self, *}, T, @@ -14,7 +14,8 @@ use super::{ argument::is_at_argument_list_end, is_nth_at_name, parse_error::{expected_object_field, expected_value}, - variable::{is_at_variable, parse_variable}, + parse_literal_name, + variable::{is_at_variable, parse_variable_reference}, }; const BOOLEAN_VALUE_SET: TokenSet = token_set![TRUE_KW, FALSE_KW]; @@ -114,7 +115,7 @@ pub(crate) fn parse_default_value(p: &mut GraphqlParser) -> ParsedSyntax { #[inline] pub(crate) fn parse_value(p: &mut GraphqlParser) -> ParsedSyntax { if is_at_variable(p) { - parse_variable(p) + parse_variable_reference(p) } else if is_at_int(p) { parse_int(p) } else if is_at_float(p) { @@ -187,12 +188,12 @@ fn parse_null(p: &mut GraphqlParser) -> ParsedSyntax { } #[inline] -pub(crate) fn parse_enum_value(p: &mut GraphqlParser) -> ParsedSyntax { +fn parse_enum_value(p: &mut GraphqlParser) -> ParsedSyntax { if !is_at_enum(p) { return Absent; } let m = p.start(); - parse_name(p).ok(); + parse_literal_name(p).ok(); Present(m.complete(p, GRAPHQL_ENUM_VALUE)) } @@ -226,7 +227,7 @@ fn parse_object_field(p: &mut GraphqlParser) -> ParsedSyntax { return Absent; } let m = p.start(); - parse_name(p).ok(); + parse_literal_name(p).ok(); p.expect(T![:]); parse_value(p).or_add_diagnostic(p, expected_value); Present(m.complete(p, GRAPHQL_OBJECT_FIELD)) diff --git a/crates/biome_graphql_parser/src/parser/variable.rs b/crates/biome_graphql_parser/src/parser/variable.rs index c53c74003ad3..44b0e81863e1 100644 --- a/crates/biome_graphql_parser/src/parser/variable.rs +++ b/crates/biome_graphql_parser/src/parser/variable.rs @@ -2,19 +2,32 @@ use crate::parser::GraphqlParser; use biome_graphql_syntax::{GraphqlSyntaxKind::*, T}; use biome_parser::{parsed_syntax::ParsedSyntax, prelude::ParsedSyntax::*, Parser}; -use super::{parse_error::expected_name, parse_name}; +use super::{parse_error::expected_name, parse_literal_name}; #[inline] -pub(crate) fn parse_variable(p: &mut GraphqlParser) -> ParsedSyntax { +pub(crate) fn parse_variable_binding(p: &mut GraphqlParser) -> ParsedSyntax { if !is_at_variable(p) { return Absent; } let m = p.start(); p.bump(T![$]); - parse_name(p).or_add_diagnostic(p, expected_name); + parse_literal_name(p).or_add_diagnostic(p, expected_name); - Present(m.complete(p, GRAPHQL_VARIABLE)) + Present(m.complete(p, GRAPHQL_VARIABLE_BINDING)) +} + +#[inline] +pub(crate) fn parse_variable_reference(p: &mut GraphqlParser) -> ParsedSyntax { + if !is_at_variable(p) { + return Absent; + } + + let m = p.start(); + p.bump(T![$]); + parse_literal_name(p).or_add_diagnostic(p, expected_name); + + Present(m.complete(p, GRAPHQL_VARIABLE_REFERENCE)) } #[inline] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/directive_definition.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/directive_definition.graphql.snap index debe33f8351f..5c8f5ac84280 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/directive_definition.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/directive_definition.graphql.snap @@ -37,8 +37,8 @@ GraphqlRoot { description: missing (optional), directive_token: DIRECTIVE_KW@0..10 "directive" [] [Whitespace(" ")], at_token: AT@10..11 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@11..19 "example" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@11..19 "example" [] [Whitespace(" ")], }, arguments: missing (optional), repeatable_token: missing (optional), @@ -50,8 +50,8 @@ GraphqlRoot { description: missing (optional), directive_token: DIRECTIVE_KW@23..35 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")], at_token: AT@35..37 "@" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@37..40 "on" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@37..40 "on" [] [Whitespace(" ")], }, arguments: missing (optional), repeatable_token: missing (optional), @@ -67,8 +67,8 @@ GraphqlRoot { description: missing (optional), directive_token: DIRECTIVE_KW@61..73 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")], at_token: missing (required), - name: GraphqlName { - value_token: GRAPHQL_NAME@73..81 "example" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@73..81 "example" [] [Whitespace(" ")], }, arguments: missing (optional), repeatable_token: missing (optional), @@ -84,8 +84,8 @@ GraphqlRoot { description: missing (optional), directive_token: DIRECTIVE_KW@105..116 "directive" [Newline("\n")] [Whitespace(" ")], at_token: missing (required), - name: GraphqlName { - value_token: GRAPHQL_NAME@116..124 "example" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@116..124 "example" [] [Whitespace(" ")], }, arguments: missing (optional), repeatable_token: missing (optional), @@ -101,8 +101,8 @@ GraphqlRoot { description: missing (optional), directive_token: DIRECTIVE_KW@143..155 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")], at_token: AT@155..156 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@156..164 "example" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@156..164 "example" [] [Whitespace(" ")], }, arguments: missing (optional), repeatable_token: missing (optional), @@ -124,8 +124,8 @@ GraphqlRoot { items: [ DIRECTIVE_KW@200..212 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")], AT@212..213 "@" [] [], - GraphqlName { - value_token: GRAPHQL_NAME@213..226 "delegateField" [] [], + GraphqlNameBinding { + value_token: IDENT@213..226 "delegateField" [] [], }, GraphqlArgumentsDefinition { l_paren_token: L_PAREN@226..227 "(" [] [], @@ -157,9 +157,9 @@ GraphqlRoot { }, GraphqlBogus { items: [ - GRAPHQL_NAME@264..275 "directve" [Newline("\n"), Newline("\n")] [Whitespace(" ")], + IDENT@264..275 "directve" [Newline("\n"), Newline("\n")] [Whitespace(" ")], AT@275..276 "@" [] [], - GRAPHQL_NAME@276..284 "example" [] [Whitespace(" ")], + IDENT@276..284 "example" [] [Whitespace(" ")], ON_KW@284..286 "on" [] [], ], }, @@ -171,8 +171,8 @@ GraphqlRoot { items: [ DIRECTIVE_KW@286..298 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")], AT@298..299 "@" [] [], - GraphqlName { - value_token: GRAPHQL_NAME@299..307 "example" [] [Whitespace(" ")], + GraphqlNameBinding { + value_token: IDENT@299..307 "example" [] [Whitespace(" ")], }, ON_KW@307..309 "on" [] [], PIPE@309..315 "|" [Newline("\n"), Whitespace(" ")] [Whitespace(" "), Comments("#")], @@ -183,7 +183,7 @@ GraphqlRoot { items: [ GRAPHQL_INT_LITERAL@320..323 "123" [] [], PIPE@323..328 "|" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], - GRAPHQL_NAME@328..332 "name" [] [], + IDENT@328..332 "name" [] [], ], }, ], @@ -205,8 +205,8 @@ GraphqlRoot { 0: (empty) 1: DIRECTIVE_KW@0..10 "directive" [] [Whitespace(" ")] 2: AT@10..11 "@" [] [] - 3: GRAPHQL_NAME@11..19 - 0: GRAPHQL_NAME@11..19 "example" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_BINDING@11..19 + 0: IDENT@11..19 "example" [] [Whitespace(" ")] 4: (empty) 5: (empty) 6: ON_KW@19..22 "on" [] [Whitespace(" ")] @@ -216,8 +216,8 @@ GraphqlRoot { 0: (empty) 1: DIRECTIVE_KW@23..35 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: AT@35..37 "@" [] [Whitespace(" ")] - 3: GRAPHQL_NAME@37..40 - 0: GRAPHQL_NAME@37..40 "on" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_BINDING@37..40 + 0: IDENT@37..40 "on" [] [Whitespace(" ")] 4: (empty) 5: (empty) 6: (empty) @@ -229,8 +229,8 @@ GraphqlRoot { 0: (empty) 1: DIRECTIVE_KW@61..73 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: (empty) - 3: GRAPHQL_NAME@73..81 - 0: GRAPHQL_NAME@73..81 "example" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_BINDING@73..81 + 0: IDENT@73..81 "example" [] [Whitespace(" ")] 4: (empty) 5: (empty) 6: ON_KW@81..84 "on" [] [Whitespace(" ")] @@ -242,8 +242,8 @@ GraphqlRoot { 0: (empty) 1: DIRECTIVE_KW@105..116 "directive" [Newline("\n")] [Whitespace(" ")] 2: (empty) - 3: GRAPHQL_NAME@116..124 - 0: GRAPHQL_NAME@116..124 "example" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_BINDING@116..124 + 0: IDENT@116..124 "example" [] [Whitespace(" ")] 4: (empty) 5: (empty) 6: (empty) @@ -255,8 +255,8 @@ GraphqlRoot { 0: (empty) 1: DIRECTIVE_KW@143..155 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: AT@155..156 "@" [] [] - 3: GRAPHQL_NAME@156..164 - 0: GRAPHQL_NAME@156..164 "example" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_BINDING@156..164 + 0: IDENT@156..164 "example" [] [Whitespace(" ")] 4: (empty) 5: (empty) 6: ON_KW@164..166 "on" [] [] @@ -272,8 +272,8 @@ GraphqlRoot { 5: GRAPHQL_BOGUS_DEFINITION@200..286 0: DIRECTIVE_KW@200..212 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: AT@212..213 "@" [] [] - 2: GRAPHQL_NAME@213..226 - 0: GRAPHQL_NAME@213..226 "delegateField" [] [] + 2: GRAPHQL_NAME_BINDING@213..226 + 0: IDENT@213..226 "delegateField" [] [] 3: GRAPHQL_ARGUMENTS_DEFINITION@226..232 0: L_PAREN@226..227 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@227..230 @@ -296,15 +296,15 @@ GraphqlRoot { 2: GRAPHQL_DIRECTIVE_LOCATION@255..264 0: UPPER_INTERFACE_KW@255..264 "INTERFACE" [] [] 3: GRAPHQL_BOGUS@264..286 - 0: GRAPHQL_NAME@264..275 "directve" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 0: IDENT@264..275 "directve" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: AT@275..276 "@" [] [] - 2: GRAPHQL_NAME@276..284 "example" [] [Whitespace(" ")] + 2: IDENT@276..284 "example" [] [Whitespace(" ")] 3: ON_KW@284..286 "on" [] [] 6: GRAPHQL_BOGUS_DEFINITION@286..332 0: DIRECTIVE_KW@286..298 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: AT@298..299 "@" [] [] - 2: GRAPHQL_NAME@299..307 - 0: GRAPHQL_NAME@299..307 "example" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@299..307 + 0: IDENT@299..307 "example" [] [Whitespace(" ")] 3: ON_KW@307..309 "on" [] [] 4: PIPE@309..315 "|" [Newline("\n"), Whitespace(" ")] [Whitespace(" "), Comments("#")] 5: GRAPHQL_BOGUS@315..332 @@ -312,7 +312,7 @@ GraphqlRoot { 1: GRAPHQL_BOGUS@320..332 0: GRAPHQL_INT_LITERAL@320..323 "123" [] [] 1: PIPE@323..328 "|" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] - 2: GRAPHQL_NAME@328..332 "name" [] [] + 2: IDENT@328..332 "name" [] [] 2: EOF@332..333 "" [Newline("\n")] [] ``` diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/enum.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/enum.graphql.snap index 39892729bf33..47bd89960d82 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/enum.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/enum.graphql.snap @@ -41,8 +41,8 @@ GraphqlRoot { GraphqlEnumTypeDefinition { description: missing (optional), enum_token: ENUM_KW@0..5 "enum" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@5..14 "Direction" [] [], + name: GraphqlNameBinding { + value_token: IDENT@5..14 "Direction" [] [], }, directives: GraphqlDirectiveList [], enum_values: GraphqlEnumValuesDefinition { @@ -50,37 +50,29 @@ GraphqlRoot { values: GraphqlEnumValueList [ GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@14..22 "NORTH" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@14..22 "NORTH" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@22..29 "EAST" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@22..29 "EAST" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@29..37 "SOUTH" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@29..37 "SOUTH" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@37..44 "WEST" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@37..44 "WEST" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, @@ -91,8 +83,8 @@ GraphqlRoot { GraphqlEnumTypeDefinition { description: missing (optional), enum_token: ENUM_KW@46..125 "enum" [Newline("\n"), Newline("\n"), Comments("# the following 2 inv ..."), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@125..135 "Direction" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@125..135 "Direction" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], enum_values: GraphqlEnumValuesDefinition { @@ -100,19 +92,15 @@ GraphqlRoot { values: GraphqlEnumValueList [ GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@136..143 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - }, + value: GraphqlLiteralName { + value_token: IDENT@136..143 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], }, GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@143..153 "Direction" [] [Whitespace(" ")], - }, + value: GraphqlLiteralName { + value_token: IDENT@143..153 "Direction" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], }, @@ -123,8 +111,8 @@ GraphqlRoot { GraphqlEnumTypeDefinition { description: missing (optional), enum_token: ENUM_KW@154..161 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@161..171 "Direction" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@161..171 "Direction" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], enum_values: GraphqlEnumValuesDefinition { @@ -136,8 +124,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@172..175 "@" [Newline("\n"), Whitespace("\t")] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@175..185 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@175..185 "deprecated" [] [], }, arguments: missing (optional), }, @@ -149,21 +137,21 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@187..193 "enu" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GRAPHQL_NAME@193..202 "Direction" [] [], + IDENT@187..193 "enu" [Newline("\n"), Newline("\n")] [Whitespace(" ")], + IDENT@193..202 "Direction" [] [], ], }, GraphqlEnumTypeDefinition { description: missing (optional), enum_token: ENUM_KW@202..209 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@209..219 "Direction" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@209..219 "Direction" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@219..220 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@220..228 "NORTH" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlNameReference { + value_token: IDENT@220..228 "NORTH" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), }, @@ -178,8 +166,8 @@ GraphqlRoot { GraphqlEnumTypeDefinition { description: missing (optional), enum_token: ENUM_KW@230..237 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@237..246 "Direction" [] [], + name: GraphqlNameBinding { + value_token: IDENT@237..246 "Direction" [] [], }, directives: GraphqlDirectiveList [], enum_values: GraphqlEnumValuesDefinition { @@ -187,10 +175,8 @@ GraphqlRoot { values: GraphqlEnumValueList [ GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@246..254 "NORTH" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@246..254 "NORTH" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, @@ -212,64 +198,58 @@ GraphqlRoot { 0: GRAPHQL_ENUM_TYPE_DEFINITION@0..46 0: (empty) 1: ENUM_KW@0..5 "enum" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@5..14 - 0: GRAPHQL_NAME@5..14 "Direction" [] [] + 2: GRAPHQL_NAME_BINDING@5..14 + 0: IDENT@5..14 "Direction" [] [] 3: GRAPHQL_DIRECTIVE_LIST@14..14 4: GRAPHQL_ENUM_VALUES_DEFINITION@14..46 0: (empty) 1: GRAPHQL_ENUM_VALUE_LIST@14..44 0: GRAPHQL_ENUM_VALUE_DEFINITION@14..22 0: (empty) - 1: GRAPHQL_ENUM_VALUE@14..22 - 0: GRAPHQL_NAME@14..22 - 0: GRAPHQL_NAME@14..22 "NORTH" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@14..22 + 0: IDENT@14..22 "NORTH" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@22..22 1: GRAPHQL_ENUM_VALUE_DEFINITION@22..29 0: (empty) - 1: GRAPHQL_ENUM_VALUE@22..29 - 0: GRAPHQL_NAME@22..29 - 0: GRAPHQL_NAME@22..29 "EAST" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@22..29 + 0: IDENT@22..29 "EAST" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@29..29 2: GRAPHQL_ENUM_VALUE_DEFINITION@29..37 0: (empty) - 1: GRAPHQL_ENUM_VALUE@29..37 - 0: GRAPHQL_NAME@29..37 - 0: GRAPHQL_NAME@29..37 "SOUTH" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@29..37 + 0: IDENT@29..37 "SOUTH" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@37..37 3: GRAPHQL_ENUM_VALUE_DEFINITION@37..44 0: (empty) - 1: GRAPHQL_ENUM_VALUE@37..44 - 0: GRAPHQL_NAME@37..44 - 0: GRAPHQL_NAME@37..44 "WEST" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@37..44 + 0: IDENT@37..44 "WEST" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@44..44 2: R_CURLY@44..46 "}" [Newline("\n")] [] 1: GRAPHQL_ENUM_TYPE_DEFINITION@46..154 0: (empty) 1: ENUM_KW@46..125 "enum" [Newline("\n"), Newline("\n"), Comments("# the following 2 inv ..."), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@125..135 - 0: GRAPHQL_NAME@125..135 "Direction" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@125..135 + 0: IDENT@125..135 "Direction" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@135..135 4: GRAPHQL_ENUM_VALUES_DEFINITION@135..154 0: L_CURLY@135..136 "{" [] [] 1: GRAPHQL_ENUM_VALUE_LIST@136..153 0: GRAPHQL_ENUM_VALUE_DEFINITION@136..143 0: (empty) - 1: GRAPHQL_ENUM_VALUE@136..143 - 0: GRAPHQL_NAME@136..143 - 0: GRAPHQL_NAME@136..143 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@136..143 + 0: IDENT@136..143 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@143..143 1: GRAPHQL_ENUM_VALUE_DEFINITION@143..153 0: (empty) - 1: GRAPHQL_ENUM_VALUE@143..153 - 0: GRAPHQL_NAME@143..153 - 0: GRAPHQL_NAME@143..153 "Direction" [] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@143..153 + 0: IDENT@143..153 "Direction" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@153..153 2: R_CURLY@153..154 "}" [] [] 2: GRAPHQL_ENUM_TYPE_DEFINITION@154..187 0: (empty) 1: ENUM_KW@154..161 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@161..171 - 0: GRAPHQL_NAME@161..171 "Direction" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@161..171 + 0: IDENT@161..171 "Direction" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@171..171 4: GRAPHQL_ENUM_VALUES_DEFINITION@171..187 0: L_CURLY@171..172 "{" [] [] @@ -280,23 +260,23 @@ GraphqlRoot { 2: GRAPHQL_DIRECTIVE_LIST@172..185 0: GRAPHQL_DIRECTIVE@172..185 0: AT@172..175 "@" [Newline("\n"), Whitespace("\t")] [] - 1: GRAPHQL_NAME@175..185 - 0: GRAPHQL_NAME@175..185 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@175..185 + 0: IDENT@175..185 "deprecated" [] [] 2: (empty) 2: R_CURLY@185..187 "}" [Newline("\n")] [] 3: GRAPHQL_BOGUS_DEFINITION@187..202 - 0: GRAPHQL_NAME@187..193 "enu" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@193..202 "Direction" [] [] + 0: IDENT@187..193 "enu" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 1: IDENT@193..202 "Direction" [] [] 4: GRAPHQL_ENUM_TYPE_DEFINITION@202..228 0: (empty) 1: ENUM_KW@202..209 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@209..219 - 0: GRAPHQL_NAME@209..219 "Direction" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@209..219 + 0: IDENT@209..219 "Direction" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@219..228 0: GRAPHQL_DIRECTIVE@219..228 0: AT@219..220 "@" [] [] - 1: GRAPHQL_NAME@220..228 - 0: GRAPHQL_NAME@220..228 "NORTH" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_NAME_REFERENCE@220..228 + 0: IDENT@220..228 "NORTH" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 4: (empty) 5: GRAPHQL_BOGUS_DEFINITION@228..230 @@ -304,17 +284,16 @@ GraphqlRoot { 6: GRAPHQL_ENUM_TYPE_DEFINITION@230..254 0: (empty) 1: ENUM_KW@230..237 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@237..246 - 0: GRAPHQL_NAME@237..246 "Direction" [] [] + 2: GRAPHQL_NAME_BINDING@237..246 + 0: IDENT@237..246 "Direction" [] [] 3: GRAPHQL_DIRECTIVE_LIST@246..246 4: GRAPHQL_ENUM_VALUES_DEFINITION@246..254 0: (empty) 1: GRAPHQL_ENUM_VALUE_LIST@246..254 0: GRAPHQL_ENUM_VALUE_DEFINITION@246..254 0: (empty) - 1: GRAPHQL_ENUM_VALUE@246..254 - 0: GRAPHQL_NAME@246..254 - 0: GRAPHQL_NAME@246..254 "NORTH" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@246..254 + 0: IDENT@246..254 "NORTH" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@254..254 2: (empty) 2: EOF@254..256 "" [Newline("\n"), Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/enum_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/enum_extension.graphql.snap index 19ea8bb07eec..1e48b427eac6 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/enum_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/enum_extension.graphql.snap @@ -22,8 +22,8 @@ GraphqlRoot { GraphqlEnumTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], enum_token: ENUM_KW@7..12 "enum" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@12..21 "Direction" [] [], + name: GraphqlNameReference { + value_token: IDENT@12..21 "Direction" [] [], }, directives: GraphqlDirectiveList [], enum_values: missing (optional), @@ -31,8 +31,8 @@ GraphqlRoot { GraphqlEnumTypeExtension { extend_token: EXTEND_KW@21..30 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], enum_token: ENUM_KW@30..35 "enum" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@35..44 "Direction" [] [], + name: GraphqlNameReference { + value_token: IDENT@35..44 "Direction" [] [], }, directives: GraphqlDirectiveList [], enum_values: GraphqlEnumValuesDefinition { @@ -40,10 +40,8 @@ GraphqlRoot { values: GraphqlEnumValueList [ GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@44..52 "NORTH" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@44..52 "NORTH" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, @@ -65,24 +63,23 @@ GraphqlRoot { 0: GRAPHQL_ENUM_TYPE_EXTENSION@0..21 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: ENUM_KW@7..12 "enum" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@12..21 - 0: GRAPHQL_NAME@12..21 "Direction" [] [] + 2: GRAPHQL_NAME_REFERENCE@12..21 + 0: IDENT@12..21 "Direction" [] [] 3: GRAPHQL_DIRECTIVE_LIST@21..21 4: (empty) 1: GRAPHQL_ENUM_TYPE_EXTENSION@21..54 0: EXTEND_KW@21..30 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: ENUM_KW@30..35 "enum" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@35..44 - 0: GRAPHQL_NAME@35..44 "Direction" [] [] + 2: GRAPHQL_NAME_REFERENCE@35..44 + 0: IDENT@35..44 "Direction" [] [] 3: GRAPHQL_DIRECTIVE_LIST@44..44 4: GRAPHQL_ENUM_VALUES_DEFINITION@44..54 0: (empty) 1: GRAPHQL_ENUM_VALUE_LIST@44..52 0: GRAPHQL_ENUM_VALUE_DEFINITION@44..52 0: (empty) - 1: GRAPHQL_ENUM_VALUE@44..52 - 0: GRAPHQL_NAME@44..52 - 0: GRAPHQL_NAME@44..52 "NORTH" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@44..52 + 0: IDENT@44..52 "NORTH" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@52..52 2: R_CURLY@52..54 "}" [Newline("\n")] [] 2: EOF@54..56 "" [Newline("\n"), Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/fragment.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/fragment.graphql.snap index 99b7fd1a4268..7c5871d478cf 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/fragment.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/fragment.graphql.snap @@ -34,15 +34,13 @@ GraphqlRoot { definitions: GraphqlDefinitionList [ GraphqlFragmentDefinition { fragment_token: FRAGMENT_KW@0..9 "fragment" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@9..12 "on" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@9..12 "on" [] [Whitespace(" ")], }, type_condition: GraphqlTypeCondition { on_token: ON_KW@12..15 "on" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@15..20 "User" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@15..20 "User" [] [Whitespace(" ")], }, }, directives: GraphqlDirectiveList [], @@ -51,8 +49,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@21..26 "id" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@21..26 "id" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -60,8 +58,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@26..33 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@26..33 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -73,10 +71,10 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@35..45 "fragmen" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GRAPHQL_NAME@45..58 "friendFields" [] [Whitespace(" ")], + IDENT@35..45 "fragmen" [Newline("\n"), Newline("\n")] [Whitespace(" ")], + IDENT@45..58 "friendFields" [] [Whitespace(" ")], ON_KW@58..61 "on" [] [Whitespace(" ")], - GRAPHQL_NAME@61..66 "User" [] [Whitespace(" ")], + IDENT@61..66 "User" [] [Whitespace(" ")], ], }, GraphqlSelectionSet { @@ -84,8 +82,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@67..72 "id" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@67..72 "id" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -93,8 +91,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@72..79 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@72..79 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -105,22 +103,20 @@ GraphqlRoot { }, GraphqlFragmentDefinition { fragment_token: FRAGMENT_KW@81..92 "fragment" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@92..105 "friendFields" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@92..105 "friendFields" [] [Whitespace(" ")], }, type_condition: GraphqlTypeCondition { on_token: missing (required), - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@105..110 "User" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@105..110 "User" [] [Whitespace(" ")], }, }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@110..111 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@111..122 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@111..122 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -130,8 +126,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@123..128 "id" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@123..128 "id" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -139,8 +135,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@128..135 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@128..135 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -152,15 +148,13 @@ GraphqlRoot { }, GraphqlFragmentDefinition { fragment_token: FRAGMENT_KW@137..148 "fragment" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@148..161 "friendFields" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@148..161 "friendFields" [] [Whitespace(" ")], }, type_condition: GraphqlTypeCondition { on_token: missing (required), - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@161..163 "o" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@161..163 "o" [] [Whitespace(" ")], }, }, directives: GraphqlDirectiveList [], @@ -169,15 +163,15 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@163..168 "User" [] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@163..168 "User" [] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@168..169 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@169..180 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@169..180 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -187,8 +181,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@181..186 "id" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@181..186 "id" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -196,8 +190,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@186..193 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@186..193 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -224,126 +218,123 @@ GraphqlRoot { 1: GRAPHQL_DEFINITION_LIST@0..195 0: GRAPHQL_FRAGMENT_DEFINITION@0..35 0: FRAGMENT_KW@0..9 "fragment" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@9..12 - 0: GRAPHQL_NAME@9..12 "on" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@9..12 + 0: IDENT@9..12 "on" [] [Whitespace(" ")] 2: GRAPHQL_TYPE_CONDITION@12..20 0: ON_KW@12..15 "on" [] [Whitespace(" ")] - 1: GRAPHQL_NAMED_TYPE@15..20 - 0: GRAPHQL_NAME@15..20 - 0: GRAPHQL_NAME@15..20 "User" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@15..20 + 0: IDENT@15..20 "User" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@20..20 4: GRAPHQL_SELECTION_SET@20..35 0: L_CURLY@20..21 "{" [] [] 1: GRAPHQL_SELECTION_LIST@21..33 0: GRAPHQL_FIELD@21..26 0: (empty) - 1: GRAPHQL_NAME@21..26 - 0: GRAPHQL_NAME@21..26 "id" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@21..26 + 0: IDENT@21..26 "id" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@26..26 4: (empty) 1: GRAPHQL_FIELD@26..33 0: (empty) - 1: GRAPHQL_NAME@26..33 - 0: GRAPHQL_NAME@26..33 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@26..33 + 0: IDENT@26..33 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@33..33 4: (empty) 2: R_CURLY@33..35 "}" [Newline("\n")] [] 1: GRAPHQL_BOGUS_DEFINITION@35..66 - 0: GRAPHQL_NAME@35..45 "fragmen" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@45..58 "friendFields" [] [Whitespace(" ")] + 0: IDENT@35..45 "fragmen" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 1: IDENT@45..58 "friendFields" [] [Whitespace(" ")] 2: ON_KW@58..61 "on" [] [Whitespace(" ")] - 3: GRAPHQL_NAME@61..66 "User" [] [Whitespace(" ")] + 3: IDENT@61..66 "User" [] [Whitespace(" ")] 2: GRAPHQL_SELECTION_SET@66..81 0: L_CURLY@66..67 "{" [] [] 1: GRAPHQL_SELECTION_LIST@67..79 0: GRAPHQL_FIELD@67..72 0: (empty) - 1: GRAPHQL_NAME@67..72 - 0: GRAPHQL_NAME@67..72 "id" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@67..72 + 0: IDENT@67..72 "id" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@72..72 4: (empty) 1: GRAPHQL_FIELD@72..79 0: (empty) - 1: GRAPHQL_NAME@72..79 - 0: GRAPHQL_NAME@72..79 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@72..79 + 0: IDENT@72..79 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@79..79 4: (empty) 2: R_CURLY@79..81 "}" [Newline("\n")] [] 3: GRAPHQL_FRAGMENT_DEFINITION@81..137 0: FRAGMENT_KW@81..92 "fragment" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@92..105 - 0: GRAPHQL_NAME@92..105 "friendFields" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@92..105 + 0: IDENT@92..105 "friendFields" [] [Whitespace(" ")] 2: GRAPHQL_TYPE_CONDITION@105..110 0: (empty) - 1: GRAPHQL_NAMED_TYPE@105..110 - 0: GRAPHQL_NAME@105..110 - 0: GRAPHQL_NAME@105..110 "User" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@105..110 + 0: IDENT@105..110 "User" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@110..122 0: GRAPHQL_DIRECTIVE@110..122 0: AT@110..111 "@" [] [] - 1: GRAPHQL_NAME@111..122 - 0: GRAPHQL_NAME@111..122 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@111..122 + 0: IDENT@111..122 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_SELECTION_SET@122..137 0: L_CURLY@122..123 "{" [] [] 1: GRAPHQL_SELECTION_LIST@123..135 0: GRAPHQL_FIELD@123..128 0: (empty) - 1: GRAPHQL_NAME@123..128 - 0: GRAPHQL_NAME@123..128 "id" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@123..128 + 0: IDENT@123..128 "id" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@128..128 4: (empty) 1: GRAPHQL_FIELD@128..135 0: (empty) - 1: GRAPHQL_NAME@128..135 - 0: GRAPHQL_NAME@128..135 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@128..135 + 0: IDENT@128..135 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@135..135 4: (empty) 2: R_CURLY@135..137 "}" [Newline("\n")] [] 4: GRAPHQL_FRAGMENT_DEFINITION@137..195 0: FRAGMENT_KW@137..148 "fragment" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@148..161 - 0: GRAPHQL_NAME@148..161 "friendFields" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@148..161 + 0: IDENT@148..161 "friendFields" [] [Whitespace(" ")] 2: GRAPHQL_TYPE_CONDITION@161..163 0: (empty) - 1: GRAPHQL_NAMED_TYPE@161..163 - 0: GRAPHQL_NAME@161..163 - 0: GRAPHQL_NAME@161..163 "o" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@161..163 + 0: IDENT@161..163 "o" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@163..163 4: GRAPHQL_SELECTION_SET@163..195 0: (empty) 1: GRAPHQL_SELECTION_LIST@163..195 0: GRAPHQL_FIELD@163..195 0: (empty) - 1: GRAPHQL_NAME@163..168 - 0: GRAPHQL_NAME@163..168 "User" [] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@163..168 + 0: IDENT@163..168 "User" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@168..180 0: GRAPHQL_DIRECTIVE@168..180 0: AT@168..169 "@" [] [] - 1: GRAPHQL_NAME@169..180 - 0: GRAPHQL_NAME@169..180 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@169..180 + 0: IDENT@169..180 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_SELECTION_SET@180..195 0: L_CURLY@180..181 "{" [] [] 1: GRAPHQL_SELECTION_LIST@181..193 0: GRAPHQL_FIELD@181..186 0: (empty) - 1: GRAPHQL_NAME@181..186 - 0: GRAPHQL_NAME@181..186 "id" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@181..186 + 0: IDENT@181..186 "id" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@186..186 4: (empty) 1: GRAPHQL_FIELD@186..193 0: (empty) - 1: GRAPHQL_NAME@186..193 - 0: GRAPHQL_NAME@186..193 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@186..193 + 0: IDENT@186..193 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@193..193 4: (empty) diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/input_object.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/input_object.graphql.snap index dbb2c3ef060a..f07d9281197c 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/input_object.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/input_object.graphql.snap @@ -61,8 +61,8 @@ GraphqlRoot { GraphqlInputObjectTypeDefinition { description: missing (optional), input_token: INPUT_KW@0..6 "input" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@6..13 "Point2D" [] [], + name: GraphqlNameBinding { + value_token: IDENT@6..13 "Point2D" [] [], }, directives: GraphqlDirectiveList [], input_fields: GraphqlInputFieldsDefinition { @@ -70,28 +70,24 @@ GraphqlRoot { fields: GraphqlInputFieldList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@13..17 "x" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@13..17 "x" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@17..19 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@19..24 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@19..24 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], }, GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@24..28 "y" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@24..28 "y" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@28..30 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@30..35 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@30..35 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -103,14 +99,14 @@ GraphqlRoot { GraphqlInputObjectTypeDefinition { description: missing (optional), input_token: INPUT_KW@37..45 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@45..53 "Point2D" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@45..53 "Point2D" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@53..54 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@54..65 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@54..65 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -120,14 +116,12 @@ GraphqlRoot { fields: GraphqlInputFieldList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@66..69 "x" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@66..69 "x" [Newline("\n"), Whitespace("\t")] [], }, colon_token: COLON@69..71 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@71..76 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@71..76 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -139,8 +133,8 @@ GraphqlRoot { GraphqlInputObjectTypeDefinition { description: missing (optional), input_token: INPUT_KW@78..86 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@86..94 "Point2D" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@86..94 "Point2D" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], input_fields: GraphqlInputFieldsDefinition { @@ -148,8 +142,8 @@ GraphqlRoot { fields: GraphqlInputFieldList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@95..99 "x" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@95..99 "x" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@99..101 ":" [] [Whitespace(" ")], ty: missing (required), @@ -163,8 +157,8 @@ GraphqlRoot { }, GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@104..108 "y" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@104..108 "y" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@108..110 ":" [] [Whitespace(" ")], ty: missing (required), @@ -172,8 +166,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@110..111 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@111..121 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@111..121 "deprecated" [] [], }, arguments: missing (optional), }, @@ -186,8 +180,8 @@ GraphqlRoot { GraphqlBogusDefinition { items: [ INPUT_KW@123..131 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GraphqlName { - value_token: GRAPHQL_NAME@131..139 "Point2D" [] [Whitespace(" ")], + GraphqlNameBinding { + value_token: IDENT@131..139 "Point2D" [] [Whitespace(" ")], }, GraphqlDirectiveList [], GraphqlBogus { @@ -197,15 +191,15 @@ GraphqlRoot { items: [ GraphqlBogus { items: [ - GRAPHQL_NAME@140..145 "x" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + IDENT@140..145 "x" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], EQ@145..147 "=" [] [Whitespace(" ")], GRAPHQL_INT_LITERAL@147..148 "0" [] [], ], }, GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@148..152 "y" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@148..152 "y" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@152..154 ":" [] [Whitespace(" ")], ty: missing (required), @@ -213,8 +207,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@154..155 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@155..165 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@155..165 "deprecated" [] [], }, arguments: missing (optional), }, @@ -230,8 +224,8 @@ GraphqlRoot { GraphqlBogusDefinition { items: [ INPUT_KW@167..175 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GraphqlName { - value_token: GRAPHQL_NAME@175..183 "Point2D" [] [Whitespace(" ")], + GraphqlNameBinding { + value_token: IDENT@175..183 "Point2D" [] [Whitespace(" ")], }, GraphqlDirectiveList [], GraphqlBogus { @@ -269,8 +263,8 @@ GraphqlRoot { GraphqlInputObjectTypeDefinition { description: missing (optional), input_token: INPUT_KW@198..206 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@206..214 "Point2D" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@206..214 "Point2D" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], input_fields: GraphqlInputFieldsDefinition { @@ -278,14 +272,12 @@ GraphqlRoot { fields: GraphqlInputFieldList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@215..219 "x" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@215..219 "x" [Newline("\n"), Whitespace(" ")] [], }, colon_token: missing (required), - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@219..223 "y" [Newline("\n"), Whitespace(" ")] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@219..223 "y" [Newline("\n"), Whitespace(" ")] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -297,8 +289,8 @@ GraphqlRoot { GraphqlBogusDefinition { items: [ INPUT_KW@225..233 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GraphqlName { - value_token: GRAPHQL_NAME@233..241 "Point2D" [] [Whitespace(" ")], + GraphqlNameBinding { + value_token: IDENT@233..241 "Point2D" [] [Whitespace(" ")], }, GraphqlDirectiveList [], GraphqlBogus { @@ -315,10 +307,8 @@ GraphqlRoot { description: missing (optional), name: missing (required), colon_token: COLON@245..250 ":" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@250..255 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@250..255 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -332,8 +322,8 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@257..264 "iput" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GRAPHQL_NAME@264..272 "Point2D" [] [Whitespace(" ")], + IDENT@257..264 "iput" [Newline("\n"), Newline("\n")] [Whitespace(" ")], + IDENT@264..272 "Point2D" [] [Whitespace(" ")], ], }, GraphqlSelectionSet { @@ -341,13 +331,13 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@273..276 "x" [Newline("\n"), Whitespace("\t")] [], + value: GraphqlLiteralName { + value_token: IDENT@273..276 "x" [Newline("\n"), Whitespace("\t")] [], }, colon_token: COLON@276..278 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@278..283 "Float" [] [], + name: GraphqlLiteralName { + value_token: IDENT@278..283 "Float" [] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -355,13 +345,13 @@ GraphqlRoot { }, GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@283..286 "y" [Newline("\n"), Whitespace("\t")] [], + value: GraphqlLiteralName { + value_token: IDENT@283..286 "y" [Newline("\n"), Whitespace("\t")] [], }, colon_token: COLON@286..288 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@288..293 "Float" [] [], + name: GraphqlLiteralName { + value_token: IDENT@288..293 "Float" [] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -373,8 +363,8 @@ GraphqlRoot { GraphqlBogusDefinition { items: [ INPUT_KW@295..303 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GraphqlName { - value_token: GRAPHQL_NAME@303..310 "Point2D" [] [], + GraphqlNameBinding { + value_token: IDENT@303..310 "Point2D" [] [], }, GraphqlDirectiveList [], GraphqlBogus { @@ -383,28 +373,24 @@ GraphqlRoot { items: [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@310..314 "x" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@310..314 "x" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@314..316 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@316..321 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@316..321 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], }, GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@321..325 "y" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@321..325 "y" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@325..327 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@327..332 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@327..332 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -412,7 +398,7 @@ GraphqlRoot { GraphqlBogus { items: [ INPUT_KW@332..340 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GRAPHQL_NAME@340..348 "Point2D" [] [Whitespace(" ")], + IDENT@340..348 "Point2D" [] [Whitespace(" ")], ], }, ], @@ -440,71 +426,68 @@ GraphqlRoot { 0: GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION@0..37 0: (empty) 1: INPUT_KW@0..6 "input" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@6..13 - 0: GRAPHQL_NAME@6..13 "Point2D" [] [] + 2: GRAPHQL_NAME_BINDING@6..13 + 0: IDENT@6..13 "Point2D" [] [] 3: GRAPHQL_DIRECTIVE_LIST@13..13 4: GRAPHQL_INPUT_FIELDS_DEFINITION@13..37 0: (empty) 1: GRAPHQL_INPUT_FIELD_LIST@13..35 0: GRAPHQL_INPUT_VALUE_DEFINITION@13..24 0: (empty) - 1: GRAPHQL_NAME@13..17 - 0: GRAPHQL_NAME@13..17 "x" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@13..17 + 0: IDENT@13..17 "x" [Newline("\n"), Whitespace(" ")] [] 2: COLON@17..19 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@19..24 - 0: GRAPHQL_NAME@19..24 - 0: GRAPHQL_NAME@19..24 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@19..24 + 0: IDENT@19..24 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@24..24 1: GRAPHQL_INPUT_VALUE_DEFINITION@24..35 0: (empty) - 1: GRAPHQL_NAME@24..28 - 0: GRAPHQL_NAME@24..28 "y" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@24..28 + 0: IDENT@24..28 "y" [Newline("\n"), Whitespace(" ")] [] 2: COLON@28..30 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@30..35 - 0: GRAPHQL_NAME@30..35 - 0: GRAPHQL_NAME@30..35 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@30..35 + 0: IDENT@30..35 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@35..35 2: R_CURLY@35..37 "}" [Newline("\n")] [] 1: GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION@37..78 0: (empty) 1: INPUT_KW@37..45 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@45..53 - 0: GRAPHQL_NAME@45..53 "Point2D" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@45..53 + 0: IDENT@45..53 "Point2D" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@53..65 0: GRAPHQL_DIRECTIVE@53..65 0: AT@53..54 "@" [] [] - 1: GRAPHQL_NAME@54..65 - 0: GRAPHQL_NAME@54..65 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@54..65 + 0: IDENT@54..65 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_INPUT_FIELDS_DEFINITION@65..78 0: L_CURLY@65..66 "{" [] [] 1: GRAPHQL_INPUT_FIELD_LIST@66..76 0: GRAPHQL_INPUT_VALUE_DEFINITION@66..76 0: (empty) - 1: GRAPHQL_NAME@66..69 - 0: GRAPHQL_NAME@66..69 "x" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@66..69 + 0: IDENT@66..69 "x" [Newline("\n"), Whitespace("\t")] [] 2: COLON@69..71 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@71..76 - 0: GRAPHQL_NAME@71..76 - 0: GRAPHQL_NAME@71..76 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@71..76 + 0: IDENT@71..76 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@76..76 2: R_CURLY@76..78 "}" [Newline("\n")] [] 2: GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION@78..123 0: (empty) 1: INPUT_KW@78..86 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@86..94 - 0: GRAPHQL_NAME@86..94 "Point2D" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@86..94 + 0: IDENT@86..94 "Point2D" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@94..94 4: GRAPHQL_INPUT_FIELDS_DEFINITION@94..123 0: L_CURLY@94..95 "{" [] [] 1: GRAPHQL_INPUT_FIELD_LIST@95..121 0: GRAPHQL_INPUT_VALUE_DEFINITION@95..104 0: (empty) - 1: GRAPHQL_NAME@95..99 - 0: GRAPHQL_NAME@95..99 "x" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@95..99 + 0: IDENT@95..99 "x" [Newline("\n"), Whitespace(" ")] [] 2: COLON@99..101 ":" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DEFAULT_VALUE@101..104 @@ -514,48 +497,48 @@ GraphqlRoot { 5: GRAPHQL_DIRECTIVE_LIST@104..104 1: GRAPHQL_INPUT_VALUE_DEFINITION@104..121 0: (empty) - 1: GRAPHQL_NAME@104..108 - 0: GRAPHQL_NAME@104..108 "y" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@104..108 + 0: IDENT@104..108 "y" [Newline("\n"), Whitespace(" ")] [] 2: COLON@108..110 ":" [] [Whitespace(" ")] 3: (empty) 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@110..121 0: GRAPHQL_DIRECTIVE@110..121 0: AT@110..111 "@" [] [] - 1: GRAPHQL_NAME@111..121 - 0: GRAPHQL_NAME@111..121 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@111..121 + 0: IDENT@111..121 "deprecated" [] [] 2: (empty) 2: R_CURLY@121..123 "}" [Newline("\n")] [] 3: GRAPHQL_BOGUS_DEFINITION@123..167 0: INPUT_KW@123..131 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@131..139 - 0: GRAPHQL_NAME@131..139 "Point2D" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@131..139 + 0: IDENT@131..139 "Point2D" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@139..139 3: GRAPHQL_BOGUS@139..167 0: L_CURLY@139..140 "{" [] [] 1: GRAPHQL_BOGUS@140..165 0: GRAPHQL_BOGUS@140..148 - 0: GRAPHQL_NAME@140..145 "x" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 0: IDENT@140..145 "x" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 1: EQ@145..147 "=" [] [Whitespace(" ")] 2: GRAPHQL_INT_LITERAL@147..148 "0" [] [] 1: GRAPHQL_INPUT_VALUE_DEFINITION@148..165 0: (empty) - 1: GRAPHQL_NAME@148..152 - 0: GRAPHQL_NAME@148..152 "y" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@148..152 + 0: IDENT@148..152 "y" [Newline("\n"), Whitespace(" ")] [] 2: COLON@152..154 ":" [] [Whitespace(" ")] 3: (empty) 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@154..165 0: GRAPHQL_DIRECTIVE@154..165 0: AT@154..155 "@" [] [] - 1: GRAPHQL_NAME@155..165 - 0: GRAPHQL_NAME@155..165 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@155..165 + 0: IDENT@155..165 "deprecated" [] [] 2: (empty) 2: R_CURLY@165..167 "}" [Newline("\n")] [] 4: GRAPHQL_BOGUS_DEFINITION@167..198 0: INPUT_KW@167..175 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@175..183 - 0: GRAPHQL_NAME@175..183 "Point2D" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@175..183 + 0: IDENT@175..183 "Point2D" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@183..183 3: GRAPHQL_BOGUS@183..198 0: L_CURLY@183..184 "{" [] [] @@ -578,27 +561,26 @@ GraphqlRoot { 5: GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION@198..225 0: (empty) 1: INPUT_KW@198..206 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@206..214 - 0: GRAPHQL_NAME@206..214 "Point2D" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@206..214 + 0: IDENT@206..214 "Point2D" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@214..214 4: GRAPHQL_INPUT_FIELDS_DEFINITION@214..225 0: L_CURLY@214..215 "{" [] [] 1: GRAPHQL_INPUT_FIELD_LIST@215..223 0: GRAPHQL_INPUT_VALUE_DEFINITION@215..223 0: (empty) - 1: GRAPHQL_NAME@215..219 - 0: GRAPHQL_NAME@215..219 "x" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@215..219 + 0: IDENT@215..219 "x" [Newline("\n"), Whitespace(" ")] [] 2: (empty) - 3: GRAPHQL_NAMED_TYPE@219..223 - 0: GRAPHQL_NAME@219..223 - 0: GRAPHQL_NAME@219..223 "y" [Newline("\n"), Whitespace(" ")] [] + 3: GRAPHQL_NAME_REFERENCE@219..223 + 0: IDENT@219..223 "y" [Newline("\n"), Whitespace(" ")] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@223..223 2: R_CURLY@223..225 "}" [Newline("\n")] [] 6: GRAPHQL_BOGUS_DEFINITION@225..257 0: INPUT_KW@225..233 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@233..241 - 0: GRAPHQL_NAME@233..241 "Point2D" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@233..241 + 0: IDENT@233..241 "Point2D" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@241..241 3: GRAPHQL_BOGUS@241..257 0: L_CURLY@241..242 "{" [] [] @@ -609,69 +591,66 @@ GraphqlRoot { 0: (empty) 1: (empty) 2: COLON@245..250 ":" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@250..255 - 0: GRAPHQL_NAME@250..255 - 0: GRAPHQL_NAME@250..255 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@250..255 + 0: IDENT@250..255 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@255..255 2: R_CURLY@255..257 "}" [Newline("\n")] [] 7: GRAPHQL_BOGUS_DEFINITION@257..272 - 0: GRAPHQL_NAME@257..264 "iput" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@264..272 "Point2D" [] [Whitespace(" ")] + 0: IDENT@257..264 "iput" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 1: IDENT@264..272 "Point2D" [] [Whitespace(" ")] 8: GRAPHQL_SELECTION_SET@272..295 0: L_CURLY@272..273 "{" [] [] 1: GRAPHQL_SELECTION_LIST@273..293 0: GRAPHQL_FIELD@273..283 0: GRAPHQL_ALIAS@273..278 - 0: GRAPHQL_NAME@273..276 - 0: GRAPHQL_NAME@273..276 "x" [Newline("\n"), Whitespace("\t")] [] + 0: GRAPHQL_LITERAL_NAME@273..276 + 0: IDENT@273..276 "x" [Newline("\n"), Whitespace("\t")] [] 1: COLON@276..278 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@278..283 - 0: GRAPHQL_NAME@278..283 "Float" [] [] + 1: GRAPHQL_LITERAL_NAME@278..283 + 0: IDENT@278..283 "Float" [] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@283..283 4: (empty) 1: GRAPHQL_FIELD@283..293 0: GRAPHQL_ALIAS@283..288 - 0: GRAPHQL_NAME@283..286 - 0: GRAPHQL_NAME@283..286 "y" [Newline("\n"), Whitespace("\t")] [] + 0: GRAPHQL_LITERAL_NAME@283..286 + 0: IDENT@283..286 "y" [Newline("\n"), Whitespace("\t")] [] 1: COLON@286..288 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@288..293 - 0: GRAPHQL_NAME@288..293 "Float" [] [] + 1: GRAPHQL_LITERAL_NAME@288..293 + 0: IDENT@288..293 "Float" [] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@293..293 4: (empty) 2: R_CURLY@293..295 "}" [Newline("\n")] [] 9: GRAPHQL_BOGUS_DEFINITION@295..348 0: INPUT_KW@295..303 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@303..310 - 0: GRAPHQL_NAME@303..310 "Point2D" [] [] + 1: GRAPHQL_NAME_BINDING@303..310 + 0: IDENT@303..310 "Point2D" [] [] 2: GRAPHQL_DIRECTIVE_LIST@310..310 3: GRAPHQL_BOGUS@310..348 0: GRAPHQL_BOGUS@310..348 0: GRAPHQL_INPUT_VALUE_DEFINITION@310..321 0: (empty) - 1: GRAPHQL_NAME@310..314 - 0: GRAPHQL_NAME@310..314 "x" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@310..314 + 0: IDENT@310..314 "x" [Newline("\n"), Whitespace(" ")] [] 2: COLON@314..316 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@316..321 - 0: GRAPHQL_NAME@316..321 - 0: GRAPHQL_NAME@316..321 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@316..321 + 0: IDENT@316..321 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@321..321 1: GRAPHQL_INPUT_VALUE_DEFINITION@321..332 0: (empty) - 1: GRAPHQL_NAME@321..325 - 0: GRAPHQL_NAME@321..325 "y" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@321..325 + 0: IDENT@321..325 "y" [Newline("\n"), Whitespace(" ")] [] 2: COLON@325..327 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@327..332 - 0: GRAPHQL_NAME@327..332 - 0: GRAPHQL_NAME@327..332 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@327..332 + 0: IDENT@327..332 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@332..332 2: GRAPHQL_BOGUS@332..348 0: INPUT_KW@332..340 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@340..348 "Point2D" [] [Whitespace(" ")] + 1: IDENT@340..348 "Point2D" [] [Whitespace(" ")] 10: GRAPHQL_SELECTION_SET@348..349 0: L_CURLY@348..349 "{" [] [] 1: GRAPHQL_SELECTION_LIST@349..349 diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/input_object_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/input_object_extension.graphql.snap index e01e0b0fcf23..09e4a3ebf71b 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/input_object_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/input_object_extension.graphql.snap @@ -22,8 +22,8 @@ GraphqlRoot { GraphqlInputObjectTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], input_token: INPUT_KW@7..13 "input" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@13..20 "Point2D" [] [], + name: GraphqlNameReference { + value_token: IDENT@13..20 "Point2D" [] [], }, directives: GraphqlDirectiveList [], input_fields: missing (optional), @@ -31,8 +31,8 @@ GraphqlRoot { GraphqlInputObjectTypeExtension { extend_token: EXTEND_KW@20..29 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], input_token: INPUT_KW@29..35 "input" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@35..42 "Point2D" [] [], + name: GraphqlNameReference { + value_token: IDENT@35..42 "Point2D" [] [], }, directives: GraphqlDirectiveList [], input_fields: GraphqlInputFieldsDefinition { @@ -40,28 +40,24 @@ GraphqlRoot { fields: GraphqlInputFieldList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@42..46 "x" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@42..46 "x" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@46..48 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@48..53 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@48..53 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], }, GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@53..57 "y" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@53..57 "y" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@57..59 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@59..64 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@59..64 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -84,37 +80,35 @@ GraphqlRoot { 0: GRAPHQL_INPUT_OBJECT_TYPE_EXTENSION@0..20 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: INPUT_KW@7..13 "input" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@13..20 - 0: GRAPHQL_NAME@13..20 "Point2D" [] [] + 2: GRAPHQL_NAME_REFERENCE@13..20 + 0: IDENT@13..20 "Point2D" [] [] 3: GRAPHQL_DIRECTIVE_LIST@20..20 4: (empty) 1: GRAPHQL_INPUT_OBJECT_TYPE_EXTENSION@20..66 0: EXTEND_KW@20..29 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: INPUT_KW@29..35 "input" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@35..42 - 0: GRAPHQL_NAME@35..42 "Point2D" [] [] + 2: GRAPHQL_NAME_REFERENCE@35..42 + 0: IDENT@35..42 "Point2D" [] [] 3: GRAPHQL_DIRECTIVE_LIST@42..42 4: GRAPHQL_INPUT_FIELDS_DEFINITION@42..66 0: (empty) 1: GRAPHQL_INPUT_FIELD_LIST@42..64 0: GRAPHQL_INPUT_VALUE_DEFINITION@42..53 0: (empty) - 1: GRAPHQL_NAME@42..46 - 0: GRAPHQL_NAME@42..46 "x" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@42..46 + 0: IDENT@42..46 "x" [Newline("\n"), Whitespace(" ")] [] 2: COLON@46..48 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@48..53 - 0: GRAPHQL_NAME@48..53 - 0: GRAPHQL_NAME@48..53 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@48..53 + 0: IDENT@48..53 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@53..53 1: GRAPHQL_INPUT_VALUE_DEFINITION@53..64 0: (empty) - 1: GRAPHQL_NAME@53..57 - 0: GRAPHQL_NAME@53..57 "y" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@53..57 + 0: IDENT@53..57 "y" [Newline("\n"), Whitespace(" ")] [] 2: COLON@57..59 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@59..64 - 0: GRAPHQL_NAME@59..64 - 0: GRAPHQL_NAME@59..64 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@59..64 + 0: IDENT@59..64 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@64..64 2: R_CURLY@64..66 "}" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/interface.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/interface.graphql.snap index b7990434da4d..2663dbef8341 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/interface.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/interface.graphql.snap @@ -79,8 +79,8 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@0..10 "interface" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@10..16 "Person" [] [], + name: GraphqlNameBinding { + value_token: IDENT@10..16 "Person" [] [], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -89,15 +89,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@16..23 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@16..23 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@23..25 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@25..31 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@25..31 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -108,8 +106,8 @@ GraphqlRoot { GraphqlBogusDefinition { items: [ INTERFACE_KW@33..45 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GraphqlName { - value_token: GRAPHQL_NAME@45..52 "Person" [] [Whitespace(" ")], + GraphqlNameBinding { + value_token: IDENT@45..52 "Person" [] [Whitespace(" ")], }, GraphqlDirectiveList [], GraphqlBogus { @@ -119,42 +117,38 @@ GraphqlRoot { items: [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@53..60 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@53..60 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@60..62 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@62..68 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@62..68 "String" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlBogus { items: [ INTERFACE_KW@68..80 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GRAPHQL_NAME@80..86 "Person" [] [], + IDENT@80..86 "Person" [] [], ], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@86..93 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@86..93 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@93..95 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@95..101 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@95..101 "String" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlBogus { items: [ INTERFACE_KW@101..113 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GRAPHQL_NAME@113..120 "Person" [] [Whitespace(" ")], + IDENT@113..120 "Person" [] [Whitespace(" ")], ], }, ], @@ -168,8 +162,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@121..128 "name" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@121..128 "name" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@128..129 ":" [] [], }, @@ -184,8 +178,8 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@131..143 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@143..150 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@143..150 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -197,10 +191,8 @@ GraphqlRoot { name: missing (required), arguments: missing (optional), colon_token: COLON@151..156 ":" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@156..162 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@156..162 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -211,8 +203,8 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@164..176 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@176..183 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@176..183 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -234,8 +226,8 @@ GraphqlRoot { GraphqlBogusDefinition { items: [ INTERFACE_KW@190..202 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GraphqlName { - value_token: GRAPHQL_NAME@202..209 "Person" [] [Whitespace(" ")], + GraphqlNameBinding { + value_token: IDENT@202..209 "Person" [] [Whitespace(" ")], }, GraphqlDirectiveList [], GraphqlBogus { @@ -245,8 +237,8 @@ GraphqlRoot { items: [ GraphqlBogus { items: [ - GRAPHQL_NAME@210..218 "name" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], - GRAPHQL_NAME@218..224 "String" [] [], + IDENT@210..218 "name" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + IDENT@218..224 "String" [] [], ], }, ], @@ -259,8 +251,8 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@226..238 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@238..245 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@238..245 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -268,7 +260,7 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@245..256 "deprecated" [] [Whitespace(" ")], + IDENT@245..256 "deprecated" [] [Whitespace(" ")], ], }, GraphqlSelectionSet { @@ -276,13 +268,13 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@257..264 "name" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@257..264 "name" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@264..266 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@266..272 "String" [] [], + name: GraphqlLiteralName { + value_token: IDENT@266..272 "String" [] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -294,8 +286,8 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@274..286 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@286..293 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@286..293 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ @@ -310,15 +302,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@296..303 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@296..303 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@303..305 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@305..311 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@305..311 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -329,15 +319,15 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@313..325 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@325..332 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@325..332 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@332..333 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@333..340 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlNameReference { + value_token: IDENT@333..340 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), }, @@ -350,10 +340,8 @@ GraphqlRoot { name: missing (required), arguments: missing (optional), colon_token: COLON@340..342 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@342..348 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@342..348 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -364,8 +352,8 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@350..362 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@362..369 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@362..369 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -373,8 +361,8 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@369..379 "implement" [] [Whitespace(" ")], - GRAPHQL_NAME@379..389 "Character" [] [Whitespace(" ")], + IDENT@369..379 "implement" [] [Whitespace(" ")], + IDENT@379..389 "Character" [] [Whitespace(" ")], AT@389..391 "@" [] [Whitespace(" ")], ], }, @@ -383,13 +371,13 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@392..399 "name" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@392..399 "name" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@399..401 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@401..407 "String" [] [], + name: GraphqlLiteralName { + value_token: IDENT@401..407 "String" [] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -400,15 +388,15 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@409..417 "inter" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GRAPHQL_NAME@417..423 "Person" [] [], + IDENT@409..417 "inter" [Newline("\n"), Newline("\n")] [Whitespace(" ")], + IDENT@417..423 "Person" [] [], ], }, GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@423..435 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@435..442 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@435..442 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -416,38 +404,34 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@442..452 "implemets" [] [Whitespace(" ")], - GRAPHQL_NAME@452..461 "Character" [] [], + IDENT@442..452 "implemets" [] [Whitespace(" ")], + IDENT@452..461 "Character" [] [], ], }, GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@461..473 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@473..480 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@473..480 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@480..491 "implements" [] [Whitespace(" ")], amp_token: AMP@491..492 "&" [] [], interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@492..504 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@492..504 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, missing separator, - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@504..511 "Person" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@504..511 "Person" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@511..512 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@512..524 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@512..524 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -456,32 +440,28 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@524..531 "Person" [] [Whitespace(" ")], - GRAPHQL_NAME@531..540 "implents" [] [Whitespace(" ")], - GRAPHQL_NAME@540..550 "Character" [] [Whitespace(" ")], + IDENT@524..531 "Person" [] [Whitespace(" ")], + IDENT@531..540 "implents" [] [Whitespace(" ")], + IDENT@540..550 "Character" [] [Whitespace(" ")], AT@550..551 "@" [] [], ], }, GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@551..563 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@563..570 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@563..570 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@570..581 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@581..591 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@581..591 "Character" [] [Whitespace(" ")], }, AMP@591..593 "&" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@593..604 "Character1" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@593..604 "Character1" [] [Whitespace(" ")], }, AMP@604..606 "&" [] [Whitespace(" ")], missing element, @@ -490,8 +470,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@606..607 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@607..617 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@607..617 "deprecated" [] [], }, arguments: missing (optional), }, @@ -501,8 +481,8 @@ GraphqlRoot { GraphqlBogusDefinition { items: [ INTERFACE_KW@617..629 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GraphqlName { - value_token: GRAPHQL_NAME@629..636 "Person" [] [Whitespace(" ")], + GraphqlNameBinding { + value_token: IDENT@629..636 "Person" [] [Whitespace(" ")], }, GraphqlDirectiveList [], GraphqlBogus { @@ -512,16 +492,16 @@ GraphqlRoot { items: [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@637..644 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@637..644 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@644..645 "(" [] [], arguments: GraphqlArgumentDefinitionList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@645..655 "start_with" [] [], + name: GraphqlLiteralName { + value_token: IDENT@645..655 "start_with" [] [], }, colon_token: COLON@655..656 ":" [] [], ty: missing (required), @@ -532,10 +512,8 @@ GraphqlRoot { r_paren_token: R_PAREN@656..657 ")" [] [], }, colon_token: COLON@657..659 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@659..665 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@659..665 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -546,8 +524,8 @@ GraphqlRoot { }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@703..713 "picture" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@703..713 "picture" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@713..714 "(" [] [], @@ -556,10 +534,8 @@ GraphqlRoot { description: missing (optional), name: missing (required), colon_token: COLON@714..716 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@716..720 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@716..720 "Int" [] [Whitespace(" ")], }, default: GraphqlDefaultValue { eq_token: EQ@720..722 "=" [] [Whitespace(" ")], @@ -573,17 +549,15 @@ GraphqlRoot { r_paren_token: R_PAREN@723..724 ")" [] [], }, colon_token: COLON@724..726 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@726..729 "Url" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@726..729 "Url" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@729..738 "height" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@729..738 "height" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@738..739 "(" [] [], @@ -594,8 +568,8 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@739..758 "\"filter by height\"" [] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@758..770 "greater_than" [] [], + name: GraphqlLiteralName { + value_token: IDENT@758..770 "greater_than" [] [], }, colon_token: COLON@770..772 ":" [] [Whitespace(" ")], ty: missing (required), @@ -603,8 +577,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@772..773 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@773..783 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@773..783 "deprecated" [] [], }, arguments: missing (optional), }, @@ -614,17 +588,15 @@ GraphqlRoot { r_paren_token: R_PAREN@783..784 ")" [] [], }, colon_token: COLON@784..786 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@786..789 "Int" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@786..789 "Int" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@789..798 "weight" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@789..798 "weight" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@798..799 "(" [] [], @@ -635,14 +607,12 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@799..818 "\"filter by weight\"" [] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@818..830 "greater_than" [] [], + name: GraphqlLiteralName { + value_token: IDENT@818..830 "greater_than" [] [], }, colon_token: COLON@830..832 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@832..836 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@832..836 "Int" [] [Whitespace(" ")], }, default: GraphqlDefaultValue { eq_token: EQ@836..838 "=" [] [Whitespace(" ")], @@ -651,8 +621,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@838..839 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@839..849 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@839..849 "deprecated" [] [], }, arguments: missing (optional), }, @@ -662,31 +632,27 @@ GraphqlRoot { r_paren_token: R_PAREN@849..850 ")" [] [], }, colon_token: COLON@850..852 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@852..855 "Int" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@852..855 "Int" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@855..862 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@855..862 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@862..863 "(" [] [], arguments: GraphqlArgumentDefinitionList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@863..874 "start_with" [] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@863..874 "start_with" [] [Whitespace(" ")], }, colon_token: missing (required), - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@874..880 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@874..880 "String" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -695,10 +661,8 @@ GraphqlRoot { r_paren_token: R_PAREN@880..881 ")" [] [], }, colon_token: COLON@881..883 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@883..889 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@883..889 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -723,8 +687,8 @@ GraphqlRoot { 0: GRAPHQL_INTERFACE_TYPE_DEFINITION@0..33 0: (empty) 1: INTERFACE_KW@0..10 "interface" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@10..16 - 0: GRAPHQL_NAME@10..16 "Person" [] [] + 2: GRAPHQL_NAME_BINDING@10..16 + 0: IDENT@10..16 "Person" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@16..16 5: GRAPHQL_FIELDS_DEFINITION@16..33 @@ -732,56 +696,53 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@16..31 0: GRAPHQL_FIELD_DEFINITION@16..31 0: (empty) - 1: GRAPHQL_NAME@16..23 - 0: GRAPHQL_NAME@16..23 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@16..23 + 0: IDENT@16..23 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@23..25 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@25..31 - 0: GRAPHQL_NAME@25..31 - 0: GRAPHQL_NAME@25..31 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@25..31 + 0: IDENT@25..31 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@31..31 2: R_CURLY@31..33 "}" [Newline("\n")] [] 1: GRAPHQL_BOGUS_DEFINITION@33..120 0: INTERFACE_KW@33..45 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@45..52 - 0: GRAPHQL_NAME@45..52 "Person" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@45..52 + 0: IDENT@45..52 "Person" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@52..52 3: GRAPHQL_BOGUS@52..120 0: L_CURLY@52..53 "{" [] [] 1: GRAPHQL_BOGUS@53..120 0: GRAPHQL_FIELD_DEFINITION@53..68 0: (empty) - 1: GRAPHQL_NAME@53..60 - 0: GRAPHQL_NAME@53..60 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@53..60 + 0: IDENT@53..60 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@60..62 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@62..68 - 0: GRAPHQL_NAME@62..68 - 0: GRAPHQL_NAME@62..68 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@62..68 + 0: IDENT@62..68 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@68..68 1: GRAPHQL_BOGUS@68..86 0: INTERFACE_KW@68..80 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@80..86 "Person" [] [] + 1: IDENT@80..86 "Person" [] [] 2: GRAPHQL_FIELD_DEFINITION@86..101 0: (empty) - 1: GRAPHQL_NAME@86..93 - 0: GRAPHQL_NAME@86..93 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@86..93 + 0: IDENT@86..93 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@93..95 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@95..101 - 0: GRAPHQL_NAME@95..101 - 0: GRAPHQL_NAME@95..101 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@95..101 + 0: IDENT@95..101 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@101..101 3: GRAPHQL_BOGUS@101..120 0: INTERFACE_KW@101..113 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@113..120 "Person" [] [Whitespace(" ")] + 1: IDENT@113..120 "Person" [] [Whitespace(" ")] 2: GRAPHQL_SELECTION_SET@120..131 0: L_CURLY@120..121 "{" [] [] 1: GRAPHQL_SELECTION_LIST@121..129 0: GRAPHQL_FIELD@121..129 0: GRAPHQL_ALIAS@121..129 - 0: GRAPHQL_NAME@121..128 - 0: GRAPHQL_NAME@121..128 "name" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@121..128 + 0: IDENT@121..128 "name" [Newline("\n"), Whitespace(" ")] [] 1: COLON@128..129 ":" [] [] 1: (empty) 2: (empty) @@ -791,8 +752,8 @@ GraphqlRoot { 3: GRAPHQL_INTERFACE_TYPE_DEFINITION@131..164 0: (empty) 1: INTERFACE_KW@131..143 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@143..150 - 0: GRAPHQL_NAME@143..150 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@143..150 + 0: IDENT@143..150 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@150..150 5: GRAPHQL_FIELDS_DEFINITION@150..164 @@ -803,16 +764,15 @@ GraphqlRoot { 1: (empty) 2: (empty) 3: COLON@151..156 ":" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@156..162 - 0: GRAPHQL_NAME@156..162 - 0: GRAPHQL_NAME@156..162 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@156..162 + 0: IDENT@156..162 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@162..162 2: R_CURLY@162..164 "}" [Newline("\n")] [] 4: GRAPHQL_INTERFACE_TYPE_DEFINITION@164..190 0: (empty) 1: INTERFACE_KW@164..176 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@176..183 - 0: GRAPHQL_NAME@176..183 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@176..183 + 0: IDENT@176..183 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@183..183 5: GRAPHQL_FIELDS_DEFINITION@183..190 @@ -828,36 +788,36 @@ GraphqlRoot { 2: R_CURLY@188..190 "}" [Newline("\n")] [] 5: GRAPHQL_BOGUS_DEFINITION@190..226 0: INTERFACE_KW@190..202 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@202..209 - 0: GRAPHQL_NAME@202..209 "Person" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@202..209 + 0: IDENT@202..209 "Person" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@209..209 3: GRAPHQL_BOGUS@209..226 0: L_CURLY@209..210 "{" [] [] 1: GRAPHQL_BOGUS@210..224 0: GRAPHQL_BOGUS@210..224 - 0: GRAPHQL_NAME@210..218 "name" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] - 1: GRAPHQL_NAME@218..224 "String" [] [] + 0: IDENT@210..218 "name" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 1: IDENT@218..224 "String" [] [] 2: R_CURLY@224..226 "}" [Newline("\n")] [] 6: GRAPHQL_INTERFACE_TYPE_DEFINITION@226..245 0: (empty) 1: INTERFACE_KW@226..238 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@238..245 - 0: GRAPHQL_NAME@238..245 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@238..245 + 0: IDENT@238..245 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@245..245 5: (empty) 7: GRAPHQL_BOGUS_DEFINITION@245..256 - 0: GRAPHQL_NAME@245..256 "deprecated" [] [Whitespace(" ")] + 0: IDENT@245..256 "deprecated" [] [Whitespace(" ")] 8: GRAPHQL_SELECTION_SET@256..274 0: L_CURLY@256..257 "{" [] [] 1: GRAPHQL_SELECTION_LIST@257..272 0: GRAPHQL_FIELD@257..272 0: GRAPHQL_ALIAS@257..266 - 0: GRAPHQL_NAME@257..264 - 0: GRAPHQL_NAME@257..264 "name" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@257..264 + 0: IDENT@257..264 "name" [Newline("\n"), Whitespace(" ")] [] 1: COLON@264..266 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@266..272 - 0: GRAPHQL_NAME@266..272 "String" [] [] + 1: GRAPHQL_LITERAL_NAME@266..272 + 0: IDENT@266..272 "String" [] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@272..272 4: (empty) @@ -865,8 +825,8 @@ GraphqlRoot { 9: GRAPHQL_INTERFACE_TYPE_DEFINITION@274..313 0: (empty) 1: INTERFACE_KW@274..286 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@286..293 - 0: GRAPHQL_NAME@286..293 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@286..293 + 0: IDENT@286..293 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@293..295 0: GRAPHQL_DIRECTIVE@293..295 @@ -878,26 +838,25 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@296..311 0: GRAPHQL_FIELD_DEFINITION@296..311 0: (empty) - 1: GRAPHQL_NAME@296..303 - 0: GRAPHQL_NAME@296..303 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@296..303 + 0: IDENT@296..303 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@303..305 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@305..311 - 0: GRAPHQL_NAME@305..311 - 0: GRAPHQL_NAME@305..311 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@305..311 + 0: IDENT@305..311 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@311..311 2: R_CURLY@311..313 "}" [Newline("\n")] [] 10: GRAPHQL_INTERFACE_TYPE_DEFINITION@313..350 0: (empty) 1: INTERFACE_KW@313..325 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@325..332 - 0: GRAPHQL_NAME@325..332 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@325..332 + 0: IDENT@325..332 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@332..340 0: GRAPHQL_DIRECTIVE@332..340 0: AT@332..333 "@" [] [] - 1: GRAPHQL_NAME@333..340 - 0: GRAPHQL_NAME@333..340 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_NAME_REFERENCE@333..340 + 0: IDENT@333..340 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 5: GRAPHQL_FIELDS_DEFINITION@340..350 0: (empty) @@ -907,139 +866,133 @@ GraphqlRoot { 1: (empty) 2: (empty) 3: COLON@340..342 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@342..348 - 0: GRAPHQL_NAME@342..348 - 0: GRAPHQL_NAME@342..348 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@342..348 + 0: IDENT@342..348 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@348..348 2: R_CURLY@348..350 "}" [Newline("\n")] [] 11: GRAPHQL_INTERFACE_TYPE_DEFINITION@350..369 0: (empty) 1: INTERFACE_KW@350..362 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@362..369 - 0: GRAPHQL_NAME@362..369 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@362..369 + 0: IDENT@362..369 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@369..369 5: (empty) 12: GRAPHQL_BOGUS_DEFINITION@369..391 - 0: GRAPHQL_NAME@369..379 "implement" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@379..389 "Character" [] [Whitespace(" ")] + 0: IDENT@369..379 "implement" [] [Whitespace(" ")] + 1: IDENT@379..389 "Character" [] [Whitespace(" ")] 2: AT@389..391 "@" [] [Whitespace(" ")] 13: GRAPHQL_SELECTION_SET@391..409 0: L_CURLY@391..392 "{" [] [] 1: GRAPHQL_SELECTION_LIST@392..407 0: GRAPHQL_FIELD@392..407 0: GRAPHQL_ALIAS@392..401 - 0: GRAPHQL_NAME@392..399 - 0: GRAPHQL_NAME@392..399 "name" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@392..399 + 0: IDENT@392..399 "name" [Newline("\n"), Whitespace(" ")] [] 1: COLON@399..401 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@401..407 - 0: GRAPHQL_NAME@401..407 "String" [] [] + 1: GRAPHQL_LITERAL_NAME@401..407 + 0: IDENT@401..407 "String" [] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@407..407 4: (empty) 2: R_CURLY@407..409 "}" [Newline("\n")] [] 14: GRAPHQL_BOGUS_DEFINITION@409..423 - 0: GRAPHQL_NAME@409..417 "inter" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@417..423 "Person" [] [] + 0: IDENT@409..417 "inter" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 1: IDENT@417..423 "Person" [] [] 15: GRAPHQL_INTERFACE_TYPE_DEFINITION@423..442 0: (empty) 1: INTERFACE_KW@423..435 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@435..442 - 0: GRAPHQL_NAME@435..442 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@435..442 + 0: IDENT@435..442 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@442..442 5: (empty) 16: GRAPHQL_BOGUS_DEFINITION@442..461 - 0: GRAPHQL_NAME@442..452 "implemets" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@452..461 "Character" [] [] + 0: IDENT@442..452 "implemets" [] [Whitespace(" ")] + 1: IDENT@452..461 "Character" [] [] 17: GRAPHQL_INTERFACE_TYPE_DEFINITION@461..524 0: (empty) 1: INTERFACE_KW@461..473 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@473..480 - 0: GRAPHQL_NAME@473..480 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@473..480 + 0: IDENT@473..480 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@480..511 0: IMPLEMENTS_KW@480..491 "implements" [] [Whitespace(" ")] 1: AMP@491..492 "&" [] [] 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@492..511 - 0: GRAPHQL_NAMED_TYPE@492..504 - 0: GRAPHQL_NAME@492..504 - 0: GRAPHQL_NAME@492..504 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@492..504 + 0: IDENT@492..504 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: (empty) - 2: GRAPHQL_NAMED_TYPE@504..511 - 0: GRAPHQL_NAME@504..511 - 0: GRAPHQL_NAME@504..511 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@504..511 + 0: IDENT@504..511 "Person" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@511..524 0: GRAPHQL_DIRECTIVE@511..524 0: AT@511..512 "@" [] [] - 1: GRAPHQL_NAME@512..524 - 0: GRAPHQL_NAME@512..524 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@512..524 + 0: IDENT@512..524 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: (empty) 5: (empty) 18: GRAPHQL_BOGUS_DEFINITION@524..551 - 0: GRAPHQL_NAME@524..531 "Person" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@531..540 "implents" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@540..550 "Character" [] [Whitespace(" ")] + 0: IDENT@524..531 "Person" [] [Whitespace(" ")] + 1: IDENT@531..540 "implents" [] [Whitespace(" ")] + 2: IDENT@540..550 "Character" [] [Whitespace(" ")] 3: AT@550..551 "@" [] [] 19: GRAPHQL_INTERFACE_TYPE_DEFINITION@551..617 0: (empty) 1: INTERFACE_KW@551..563 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@563..570 - 0: GRAPHQL_NAME@563..570 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@563..570 + 0: IDENT@563..570 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@570..606 0: IMPLEMENTS_KW@570..581 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@581..606 - 0: GRAPHQL_NAMED_TYPE@581..591 - 0: GRAPHQL_NAME@581..591 - 0: GRAPHQL_NAME@581..591 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@581..591 + 0: IDENT@581..591 "Character" [] [Whitespace(" ")] 1: AMP@591..593 "&" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@593..604 - 0: GRAPHQL_NAME@593..604 - 0: GRAPHQL_NAME@593..604 "Character1" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@593..604 + 0: IDENT@593..604 "Character1" [] [Whitespace(" ")] 3: AMP@604..606 "&" [] [Whitespace(" ")] 4: (empty) 4: GRAPHQL_DIRECTIVE_LIST@606..617 0: GRAPHQL_DIRECTIVE@606..617 0: AT@606..607 "@" [] [] - 1: GRAPHQL_NAME@607..617 - 0: GRAPHQL_NAME@607..617 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@607..617 + 0: IDENT@607..617 "deprecated" [] [] 2: (empty) 5: (empty) 20: GRAPHQL_BOGUS_DEFINITION@617..891 0: INTERFACE_KW@617..629 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@629..636 - 0: GRAPHQL_NAME@629..636 "Person" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@629..636 + 0: IDENT@629..636 "Person" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@636..636 3: GRAPHQL_BOGUS@636..891 0: L_CURLY@636..637 "{" [] [] 1: GRAPHQL_BOGUS@637..889 0: GRAPHQL_FIELD_DEFINITION@637..665 0: (empty) - 1: GRAPHQL_NAME@637..644 - 0: GRAPHQL_NAME@637..644 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@637..644 + 0: IDENT@637..644 "name" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@644..657 0: L_PAREN@644..645 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@645..656 0: GRAPHQL_INPUT_VALUE_DEFINITION@645..656 0: (empty) - 1: GRAPHQL_NAME@645..655 - 0: GRAPHQL_NAME@645..655 "start_with" [] [] + 1: GRAPHQL_LITERAL_NAME@645..655 + 0: IDENT@645..655 "start_with" [] [] 2: COLON@655..656 ":" [] [] 3: (empty) 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@656..656 2: R_PAREN@656..657 ")" [] [] 3: COLON@657..659 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@659..665 - 0: GRAPHQL_NAME@659..665 - 0: GRAPHQL_NAME@659..665 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@659..665 + 0: IDENT@659..665 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@665..665 1: GRAPHQL_BOGUS@665..703 0: ERROR_TOKEN@665..703 "\"filder by age age: Int @deprecated" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_FIELD_DEFINITION@703..729 0: (empty) - 1: GRAPHQL_NAME@703..713 - 0: GRAPHQL_NAME@703..713 "picture" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@703..713 + 0: IDENT@703..713 "picture" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@713..724 0: L_PAREN@713..714 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@714..723 @@ -1047,9 +1000,8 @@ GraphqlRoot { 0: (empty) 1: (empty) 2: COLON@714..716 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@716..720 - 0: GRAPHQL_NAME@716..720 - 0: GRAPHQL_NAME@716..720 "Int" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@716..720 + 0: IDENT@716..720 "Int" [] [Whitespace(" ")] 4: GRAPHQL_DEFAULT_VALUE@720..723 0: EQ@720..722 "=" [] [Whitespace(" ")] 1: GRAPHQL_INT_VALUE@722..723 @@ -1057,14 +1009,13 @@ GraphqlRoot { 5: GRAPHQL_DIRECTIVE_LIST@723..723 2: R_PAREN@723..724 ")" [] [] 3: COLON@724..726 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@726..729 - 0: GRAPHQL_NAME@726..729 - 0: GRAPHQL_NAME@726..729 "Url" [] [] + 4: GRAPHQL_NAME_REFERENCE@726..729 + 0: IDENT@726..729 "Url" [] [] 5: GRAPHQL_DIRECTIVE_LIST@729..729 3: GRAPHQL_FIELD_DEFINITION@729..789 0: (empty) - 1: GRAPHQL_NAME@729..738 - 0: GRAPHQL_NAME@729..738 "height" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@729..738 + 0: IDENT@729..738 "height" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@738..784 0: L_PAREN@738..739 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@739..783 @@ -1072,27 +1023,26 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@739..758 0: GRAPHQL_STRING_VALUE@739..758 0: GRAPHQL_STRING_LITERAL@739..758 "\"filter by height\"" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@758..770 - 0: GRAPHQL_NAME@758..770 "greater_than" [] [] + 1: GRAPHQL_LITERAL_NAME@758..770 + 0: IDENT@758..770 "greater_than" [] [] 2: COLON@770..772 ":" [] [Whitespace(" ")] 3: (empty) 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@772..783 0: GRAPHQL_DIRECTIVE@772..783 0: AT@772..773 "@" [] [] - 1: GRAPHQL_NAME@773..783 - 0: GRAPHQL_NAME@773..783 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@773..783 + 0: IDENT@773..783 "deprecated" [] [] 2: (empty) 2: R_PAREN@783..784 ")" [] [] 3: COLON@784..786 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@786..789 - 0: GRAPHQL_NAME@786..789 - 0: GRAPHQL_NAME@786..789 "Int" [] [] + 4: GRAPHQL_NAME_REFERENCE@786..789 + 0: IDENT@786..789 "Int" [] [] 5: GRAPHQL_DIRECTIVE_LIST@789..789 4: GRAPHQL_FIELD_DEFINITION@789..855 0: (empty) - 1: GRAPHQL_NAME@789..798 - 0: GRAPHQL_NAME@789..798 "weight" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@789..798 + 0: IDENT@789..798 "weight" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@798..850 0: L_PAREN@798..799 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@799..849 @@ -1100,49 +1050,45 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@799..818 0: GRAPHQL_STRING_VALUE@799..818 0: GRAPHQL_STRING_LITERAL@799..818 "\"filter by weight\"" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@818..830 - 0: GRAPHQL_NAME@818..830 "greater_than" [] [] + 1: GRAPHQL_LITERAL_NAME@818..830 + 0: IDENT@818..830 "greater_than" [] [] 2: COLON@830..832 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@832..836 - 0: GRAPHQL_NAME@832..836 - 0: GRAPHQL_NAME@832..836 "Int" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@832..836 + 0: IDENT@832..836 "Int" [] [Whitespace(" ")] 4: GRAPHQL_DEFAULT_VALUE@836..838 0: EQ@836..838 "=" [] [Whitespace(" ")] 1: (empty) 5: GRAPHQL_DIRECTIVE_LIST@838..849 0: GRAPHQL_DIRECTIVE@838..849 0: AT@838..839 "@" [] [] - 1: GRAPHQL_NAME@839..849 - 0: GRAPHQL_NAME@839..849 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@839..849 + 0: IDENT@839..849 "deprecated" [] [] 2: (empty) 2: R_PAREN@849..850 ")" [] [] 3: COLON@850..852 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@852..855 - 0: GRAPHQL_NAME@852..855 - 0: GRAPHQL_NAME@852..855 "Int" [] [] + 4: GRAPHQL_NAME_REFERENCE@852..855 + 0: IDENT@852..855 "Int" [] [] 5: GRAPHQL_DIRECTIVE_LIST@855..855 5: GRAPHQL_FIELD_DEFINITION@855..889 0: (empty) - 1: GRAPHQL_NAME@855..862 - 0: GRAPHQL_NAME@855..862 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@855..862 + 0: IDENT@855..862 "name" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@862..881 0: L_PAREN@862..863 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@863..880 0: GRAPHQL_INPUT_VALUE_DEFINITION@863..880 0: (empty) - 1: GRAPHQL_NAME@863..874 - 0: GRAPHQL_NAME@863..874 "start_with" [] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@863..874 + 0: IDENT@863..874 "start_with" [] [Whitespace(" ")] 2: (empty) - 3: GRAPHQL_NAMED_TYPE@874..880 - 0: GRAPHQL_NAME@874..880 - 0: GRAPHQL_NAME@874..880 "String" [] [] + 3: GRAPHQL_NAME_REFERENCE@874..880 + 0: IDENT@874..880 "String" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@880..880 2: R_PAREN@880..881 ")" [] [] 3: COLON@881..883 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@883..889 - 0: GRAPHQL_NAME@883..889 - 0: GRAPHQL_NAME@883..889 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@883..889 + 0: IDENT@883..889 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@889..889 2: R_CURLY@889..891 "}" [Newline("\n")] [] 2: EOF@891..893 "" [Newline("\n"), Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/interface_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/interface_extension.graphql.snap index 3b596b69697f..22bb45a0efef 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/interface_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/interface_extension.graphql.snap @@ -21,8 +21,8 @@ GraphqlRoot { GraphqlInterfaceTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], interface_token: INTERFACE_KW@7..17 "interface" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@17..22 "Story" [] [], + name: GraphqlNameReference { + value_token: IDENT@17..22 "Story" [] [], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -31,8 +31,8 @@ GraphqlRoot { GraphqlInterfaceTypeExtension { extend_token: EXTEND_KW@22..31 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], interface_token: INTERFACE_KW@31..41 "interface" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@41..45 "User" [] [], + name: GraphqlNameReference { + value_token: IDENT@41..45 "User" [] [], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -41,15 +41,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@45..52 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@45..52 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@52..54 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@54..60 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@54..60 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -71,16 +69,16 @@ GraphqlRoot { 0: GRAPHQL_INTERFACE_TYPE_EXTENSION@0..22 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: INTERFACE_KW@7..17 "interface" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@17..22 - 0: GRAPHQL_NAME@17..22 "Story" [] [] + 2: GRAPHQL_NAME_REFERENCE@17..22 + 0: IDENT@17..22 "Story" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@22..22 5: (empty) 1: GRAPHQL_INTERFACE_TYPE_EXTENSION@22..62 0: EXTEND_KW@22..31 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: INTERFACE_KW@31..41 "interface" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@41..45 - 0: GRAPHQL_NAME@41..45 "User" [] [] + 2: GRAPHQL_NAME_REFERENCE@41..45 + 0: IDENT@41..45 "User" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@45..45 5: GRAPHQL_FIELDS_DEFINITION@45..62 @@ -88,13 +86,12 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@45..60 0: GRAPHQL_FIELD_DEFINITION@45..60 0: (empty) - 1: GRAPHQL_NAME@45..52 - 0: GRAPHQL_NAME@45..52 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@45..52 + 0: IDENT@45..52 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@52..54 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@54..60 - 0: GRAPHQL_NAME@54..60 - 0: GRAPHQL_NAME@54..60 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@54..60 + 0: IDENT@54..60 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@60..60 2: R_CURLY@60..62 "}" [Newline("\n")] [] 2: EOF@62..63 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/object.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/object.graphql.snap index 8cfbde182780..d24721f6cc55 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/object.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/object.graphql.snap @@ -79,8 +79,8 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@0..5 "type" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@5..11 "Person" [] [], + name: GraphqlNameBinding { + value_token: IDENT@5..11 "Person" [] [], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -89,15 +89,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@11..18 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@11..18 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@18..20 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@20..26 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@20..26 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -108,8 +106,8 @@ GraphqlRoot { GraphqlBogusDefinition { items: [ TYPE_KW@28..35 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GraphqlName { - value_token: GRAPHQL_NAME@35..42 "Person" [] [Whitespace(" ")], + GraphqlNameBinding { + value_token: IDENT@35..42 "Person" [] [Whitespace(" ")], }, GraphqlDirectiveList [], GraphqlBogus { @@ -119,42 +117,38 @@ GraphqlRoot { items: [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@43..50 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@43..50 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@50..52 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@52..58 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@52..58 "String" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlBogus { items: [ TYPE_KW@58..65 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GRAPHQL_NAME@65..71 "Person" [] [], + IDENT@65..71 "Person" [] [], ], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@71..78 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@71..78 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@78..80 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@80..86 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@80..86 "String" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlBogus { items: [ TYPE_KW@86..93 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GRAPHQL_NAME@93..100 "Person" [] [Whitespace(" ")], + IDENT@93..100 "Person" [] [Whitespace(" ")], ], }, ], @@ -168,8 +162,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@101..108 "name" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@101..108 "name" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@108..109 ":" [] [], }, @@ -184,8 +178,8 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@111..118 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@118..125 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@118..125 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -197,10 +191,8 @@ GraphqlRoot { name: missing (required), arguments: missing (optional), colon_token: COLON@126..131 ":" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@131..137 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@131..137 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -211,8 +203,8 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@139..146 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@146..153 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@146..153 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -234,8 +226,8 @@ GraphqlRoot { GraphqlBogusDefinition { items: [ TYPE_KW@160..167 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GraphqlName { - value_token: GRAPHQL_NAME@167..174 "Person" [] [Whitespace(" ")], + GraphqlNameBinding { + value_token: IDENT@167..174 "Person" [] [Whitespace(" ")], }, GraphqlDirectiveList [], GraphqlBogus { @@ -245,8 +237,8 @@ GraphqlRoot { items: [ GraphqlBogus { items: [ - GRAPHQL_NAME@175..183 "name" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], - GRAPHQL_NAME@183..189 "String" [] [], + IDENT@175..183 "name" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + IDENT@183..189 "String" [] [], ], }, ], @@ -259,8 +251,8 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@191..198 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@198..205 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@198..205 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -268,7 +260,7 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@205..216 "deprecated" [] [Whitespace(" ")], + IDENT@205..216 "deprecated" [] [Whitespace(" ")], ], }, GraphqlSelectionSet { @@ -276,13 +268,13 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@217..224 "name" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@217..224 "name" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@224..226 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@226..232 "String" [] [], + name: GraphqlLiteralName { + value_token: IDENT@226..232 "String" [] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -294,8 +286,8 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@234..241 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@241..248 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@241..248 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ @@ -310,15 +302,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@251..258 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@251..258 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@258..260 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@260..266 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@260..266 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -329,15 +319,15 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@268..275 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@275..282 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@275..282 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@282..283 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@283..290 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlNameReference { + value_token: IDENT@283..290 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), }, @@ -350,10 +340,8 @@ GraphqlRoot { name: missing (required), arguments: missing (optional), colon_token: COLON@290..292 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@292..298 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@292..298 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -364,8 +352,8 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@300..307 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@307..314 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@307..314 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -373,8 +361,8 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@314..324 "implement" [] [Whitespace(" ")], - GRAPHQL_NAME@324..334 "Character" [] [Whitespace(" ")], + IDENT@314..324 "implement" [] [Whitespace(" ")], + IDENT@324..334 "Character" [] [Whitespace(" ")], AT@334..336 "@" [] [Whitespace(" ")], ], }, @@ -383,13 +371,13 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@337..344 "name" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@337..344 "name" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@344..346 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@346..352 "String" [] [], + name: GraphqlLiteralName { + value_token: IDENT@346..352 "String" [] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -400,15 +388,15 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@354..360 "typ" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GRAPHQL_NAME@360..366 "Person" [] [], + IDENT@354..360 "typ" [Newline("\n"), Newline("\n")] [Whitespace(" ")], + IDENT@360..366 "Person" [] [], ], }, GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@366..373 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@373..380 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@373..380 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -416,38 +404,34 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@380..390 "implemets" [] [Whitespace(" ")], - GRAPHQL_NAME@390..399 "Character" [] [], + IDENT@380..390 "implemets" [] [Whitespace(" ")], + IDENT@390..399 "Character" [] [], ], }, GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@399..406 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@406..413 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@406..413 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@413..424 "implements" [] [Whitespace(" ")], amp_token: AMP@424..425 "&" [] [], interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@425..432 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@425..432 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, missing separator, - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@432..439 "Person" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@432..439 "Person" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@439..440 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@440..447 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@440..447 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -456,32 +440,28 @@ GraphqlRoot { }, GraphqlBogusDefinition { items: [ - GRAPHQL_NAME@447..454 "Person" [] [Whitespace(" ")], - GRAPHQL_NAME@454..463 "implents" [] [Whitespace(" ")], - GRAPHQL_NAME@463..473 "Character" [] [Whitespace(" ")], + IDENT@447..454 "Person" [] [Whitespace(" ")], + IDENT@454..463 "implents" [] [Whitespace(" ")], + IDENT@463..473 "Character" [] [Whitespace(" ")], AT@473..474 "@" [] [], ], }, GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@474..481 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@481..488 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@481..488 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@488..499 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@499..509 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@499..509 "Character" [] [Whitespace(" ")], }, AMP@509..511 "&" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@511..522 "Character1" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@511..522 "Character1" [] [Whitespace(" ")], }, AMP@522..524 "&" [] [Whitespace(" ")], missing element, @@ -490,8 +470,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@524..525 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@525..535 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@525..535 "deprecated" [] [], }, arguments: missing (optional), }, @@ -501,8 +481,8 @@ GraphqlRoot { GraphqlBogusDefinition { items: [ TYPE_KW@535..542 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - GraphqlName { - value_token: GRAPHQL_NAME@542..549 "Person" [] [Whitespace(" ")], + GraphqlNameBinding { + value_token: IDENT@542..549 "Person" [] [Whitespace(" ")], }, GraphqlDirectiveList [], GraphqlBogus { @@ -512,16 +492,16 @@ GraphqlRoot { items: [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@550..557 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@550..557 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@557..558 "(" [] [], arguments: GraphqlArgumentDefinitionList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@558..568 "start_with" [] [], + name: GraphqlLiteralName { + value_token: IDENT@558..568 "start_with" [] [], }, colon_token: COLON@568..569 ":" [] [], ty: missing (required), @@ -532,10 +512,8 @@ GraphqlRoot { r_paren_token: R_PAREN@569..570 ")" [] [], }, colon_token: COLON@570..572 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@572..578 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@572..578 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -546,8 +524,8 @@ GraphqlRoot { }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@616..626 "picture" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@616..626 "picture" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@626..627 "(" [] [], @@ -556,10 +534,8 @@ GraphqlRoot { description: missing (optional), name: missing (required), colon_token: COLON@627..629 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@629..633 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@629..633 "Int" [] [Whitespace(" ")], }, default: GraphqlDefaultValue { eq_token: EQ@633..635 "=" [] [Whitespace(" ")], @@ -573,17 +549,15 @@ GraphqlRoot { r_paren_token: R_PAREN@636..637 ")" [] [], }, colon_token: COLON@637..639 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@639..642 "Url" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@639..642 "Url" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@642..651 "height" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@642..651 "height" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@651..652 "(" [] [], @@ -594,8 +568,8 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@652..671 "\"filter by height\"" [] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@671..683 "greater_than" [] [], + name: GraphqlLiteralName { + value_token: IDENT@671..683 "greater_than" [] [], }, colon_token: COLON@683..685 ":" [] [Whitespace(" ")], ty: missing (required), @@ -603,8 +577,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@685..686 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@686..696 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@686..696 "deprecated" [] [], }, arguments: missing (optional), }, @@ -614,17 +588,15 @@ GraphqlRoot { r_paren_token: R_PAREN@696..697 ")" [] [], }, colon_token: COLON@697..699 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@699..702 "Int" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@699..702 "Int" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@702..711 "weight" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@702..711 "weight" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@711..712 "(" [] [], @@ -635,14 +607,12 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@712..731 "\"filter by weight\"" [] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@731..743 "greater_than" [] [], + name: GraphqlLiteralName { + value_token: IDENT@731..743 "greater_than" [] [], }, colon_token: COLON@743..745 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@745..749 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@745..749 "Int" [] [Whitespace(" ")], }, default: GraphqlDefaultValue { eq_token: EQ@749..751 "=" [] [Whitespace(" ")], @@ -651,8 +621,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@751..752 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@752..762 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@752..762 "deprecated" [] [], }, arguments: missing (optional), }, @@ -662,31 +632,27 @@ GraphqlRoot { r_paren_token: R_PAREN@762..763 ")" [] [], }, colon_token: COLON@763..765 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@765..768 "Int" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@765..768 "Int" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@768..775 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@768..775 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@775..776 "(" [] [], arguments: GraphqlArgumentDefinitionList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@776..787 "start_with" [] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@776..787 "start_with" [] [Whitespace(" ")], }, colon_token: missing (required), - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@787..793 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@787..793 "String" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -695,10 +661,8 @@ GraphqlRoot { r_paren_token: R_PAREN@793..794 ")" [] [], }, colon_token: COLON@794..796 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@796..802 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@796..802 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -723,8 +687,8 @@ GraphqlRoot { 0: GRAPHQL_OBJECT_TYPE_DEFINITION@0..28 0: (empty) 1: TYPE_KW@0..5 "type" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@5..11 - 0: GRAPHQL_NAME@5..11 "Person" [] [] + 2: GRAPHQL_NAME_BINDING@5..11 + 0: IDENT@5..11 "Person" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@11..11 5: GRAPHQL_FIELDS_DEFINITION@11..28 @@ -732,56 +696,53 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@11..26 0: GRAPHQL_FIELD_DEFINITION@11..26 0: (empty) - 1: GRAPHQL_NAME@11..18 - 0: GRAPHQL_NAME@11..18 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@11..18 + 0: IDENT@11..18 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@18..20 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@20..26 - 0: GRAPHQL_NAME@20..26 - 0: GRAPHQL_NAME@20..26 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@20..26 + 0: IDENT@20..26 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@26..26 2: R_CURLY@26..28 "}" [Newline("\n")] [] 1: GRAPHQL_BOGUS_DEFINITION@28..100 0: TYPE_KW@28..35 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@35..42 - 0: GRAPHQL_NAME@35..42 "Person" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@35..42 + 0: IDENT@35..42 "Person" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@42..42 3: GRAPHQL_BOGUS@42..100 0: L_CURLY@42..43 "{" [] [] 1: GRAPHQL_BOGUS@43..100 0: GRAPHQL_FIELD_DEFINITION@43..58 0: (empty) - 1: GRAPHQL_NAME@43..50 - 0: GRAPHQL_NAME@43..50 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@43..50 + 0: IDENT@43..50 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@50..52 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@52..58 - 0: GRAPHQL_NAME@52..58 - 0: GRAPHQL_NAME@52..58 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@52..58 + 0: IDENT@52..58 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@58..58 1: GRAPHQL_BOGUS@58..71 0: TYPE_KW@58..65 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@65..71 "Person" [] [] + 1: IDENT@65..71 "Person" [] [] 2: GRAPHQL_FIELD_DEFINITION@71..86 0: (empty) - 1: GRAPHQL_NAME@71..78 - 0: GRAPHQL_NAME@71..78 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@71..78 + 0: IDENT@71..78 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@78..80 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@80..86 - 0: GRAPHQL_NAME@80..86 - 0: GRAPHQL_NAME@80..86 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@80..86 + 0: IDENT@80..86 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@86..86 3: GRAPHQL_BOGUS@86..100 0: TYPE_KW@86..93 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@93..100 "Person" [] [Whitespace(" ")] + 1: IDENT@93..100 "Person" [] [Whitespace(" ")] 2: GRAPHQL_SELECTION_SET@100..111 0: L_CURLY@100..101 "{" [] [] 1: GRAPHQL_SELECTION_LIST@101..109 0: GRAPHQL_FIELD@101..109 0: GRAPHQL_ALIAS@101..109 - 0: GRAPHQL_NAME@101..108 - 0: GRAPHQL_NAME@101..108 "name" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@101..108 + 0: IDENT@101..108 "name" [Newline("\n"), Whitespace(" ")] [] 1: COLON@108..109 ":" [] [] 1: (empty) 2: (empty) @@ -791,8 +752,8 @@ GraphqlRoot { 3: GRAPHQL_OBJECT_TYPE_DEFINITION@111..139 0: (empty) 1: TYPE_KW@111..118 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@118..125 - 0: GRAPHQL_NAME@118..125 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@118..125 + 0: IDENT@118..125 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@125..125 5: GRAPHQL_FIELDS_DEFINITION@125..139 @@ -803,16 +764,15 @@ GraphqlRoot { 1: (empty) 2: (empty) 3: COLON@126..131 ":" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@131..137 - 0: GRAPHQL_NAME@131..137 - 0: GRAPHQL_NAME@131..137 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@131..137 + 0: IDENT@131..137 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@137..137 2: R_CURLY@137..139 "}" [Newline("\n")] [] 4: GRAPHQL_OBJECT_TYPE_DEFINITION@139..160 0: (empty) 1: TYPE_KW@139..146 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@146..153 - 0: GRAPHQL_NAME@146..153 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@146..153 + 0: IDENT@146..153 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@153..153 5: GRAPHQL_FIELDS_DEFINITION@153..160 @@ -828,36 +788,36 @@ GraphqlRoot { 2: R_CURLY@158..160 "}" [Newline("\n")] [] 5: GRAPHQL_BOGUS_DEFINITION@160..191 0: TYPE_KW@160..167 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@167..174 - 0: GRAPHQL_NAME@167..174 "Person" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@167..174 + 0: IDENT@167..174 "Person" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@174..174 3: GRAPHQL_BOGUS@174..191 0: L_CURLY@174..175 "{" [] [] 1: GRAPHQL_BOGUS@175..189 0: GRAPHQL_BOGUS@175..189 - 0: GRAPHQL_NAME@175..183 "name" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] - 1: GRAPHQL_NAME@183..189 "String" [] [] + 0: IDENT@175..183 "name" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 1: IDENT@183..189 "String" [] [] 2: R_CURLY@189..191 "}" [Newline("\n")] [] 6: GRAPHQL_OBJECT_TYPE_DEFINITION@191..205 0: (empty) 1: TYPE_KW@191..198 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@198..205 - 0: GRAPHQL_NAME@198..205 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@198..205 + 0: IDENT@198..205 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@205..205 5: (empty) 7: GRAPHQL_BOGUS_DEFINITION@205..216 - 0: GRAPHQL_NAME@205..216 "deprecated" [] [Whitespace(" ")] + 0: IDENT@205..216 "deprecated" [] [Whitespace(" ")] 8: GRAPHQL_SELECTION_SET@216..234 0: L_CURLY@216..217 "{" [] [] 1: GRAPHQL_SELECTION_LIST@217..232 0: GRAPHQL_FIELD@217..232 0: GRAPHQL_ALIAS@217..226 - 0: GRAPHQL_NAME@217..224 - 0: GRAPHQL_NAME@217..224 "name" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@217..224 + 0: IDENT@217..224 "name" [Newline("\n"), Whitespace(" ")] [] 1: COLON@224..226 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@226..232 - 0: GRAPHQL_NAME@226..232 "String" [] [] + 1: GRAPHQL_LITERAL_NAME@226..232 + 0: IDENT@226..232 "String" [] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@232..232 4: (empty) @@ -865,8 +825,8 @@ GraphqlRoot { 9: GRAPHQL_OBJECT_TYPE_DEFINITION@234..268 0: (empty) 1: TYPE_KW@234..241 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@241..248 - 0: GRAPHQL_NAME@241..248 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@241..248 + 0: IDENT@241..248 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@248..250 0: GRAPHQL_DIRECTIVE@248..250 @@ -878,26 +838,25 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@251..266 0: GRAPHQL_FIELD_DEFINITION@251..266 0: (empty) - 1: GRAPHQL_NAME@251..258 - 0: GRAPHQL_NAME@251..258 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@251..258 + 0: IDENT@251..258 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@258..260 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@260..266 - 0: GRAPHQL_NAME@260..266 - 0: GRAPHQL_NAME@260..266 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@260..266 + 0: IDENT@260..266 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@266..266 2: R_CURLY@266..268 "}" [Newline("\n")] [] 10: GRAPHQL_OBJECT_TYPE_DEFINITION@268..300 0: (empty) 1: TYPE_KW@268..275 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@275..282 - 0: GRAPHQL_NAME@275..282 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@275..282 + 0: IDENT@275..282 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@282..290 0: GRAPHQL_DIRECTIVE@282..290 0: AT@282..283 "@" [] [] - 1: GRAPHQL_NAME@283..290 - 0: GRAPHQL_NAME@283..290 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_NAME_REFERENCE@283..290 + 0: IDENT@283..290 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 5: GRAPHQL_FIELDS_DEFINITION@290..300 0: (empty) @@ -907,139 +866,133 @@ GraphqlRoot { 1: (empty) 2: (empty) 3: COLON@290..292 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@292..298 - 0: GRAPHQL_NAME@292..298 - 0: GRAPHQL_NAME@292..298 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@292..298 + 0: IDENT@292..298 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@298..298 2: R_CURLY@298..300 "}" [Newline("\n")] [] 11: GRAPHQL_OBJECT_TYPE_DEFINITION@300..314 0: (empty) 1: TYPE_KW@300..307 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@307..314 - 0: GRAPHQL_NAME@307..314 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@307..314 + 0: IDENT@307..314 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@314..314 5: (empty) 12: GRAPHQL_BOGUS_DEFINITION@314..336 - 0: GRAPHQL_NAME@314..324 "implement" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@324..334 "Character" [] [Whitespace(" ")] + 0: IDENT@314..324 "implement" [] [Whitespace(" ")] + 1: IDENT@324..334 "Character" [] [Whitespace(" ")] 2: AT@334..336 "@" [] [Whitespace(" ")] 13: GRAPHQL_SELECTION_SET@336..354 0: L_CURLY@336..337 "{" [] [] 1: GRAPHQL_SELECTION_LIST@337..352 0: GRAPHQL_FIELD@337..352 0: GRAPHQL_ALIAS@337..346 - 0: GRAPHQL_NAME@337..344 - 0: GRAPHQL_NAME@337..344 "name" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@337..344 + 0: IDENT@337..344 "name" [Newline("\n"), Whitespace(" ")] [] 1: COLON@344..346 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@346..352 - 0: GRAPHQL_NAME@346..352 "String" [] [] + 1: GRAPHQL_LITERAL_NAME@346..352 + 0: IDENT@346..352 "String" [] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@352..352 4: (empty) 2: R_CURLY@352..354 "}" [Newline("\n")] [] 14: GRAPHQL_BOGUS_DEFINITION@354..366 - 0: GRAPHQL_NAME@354..360 "typ" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@360..366 "Person" [] [] + 0: IDENT@354..360 "typ" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 1: IDENT@360..366 "Person" [] [] 15: GRAPHQL_OBJECT_TYPE_DEFINITION@366..380 0: (empty) 1: TYPE_KW@366..373 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@373..380 - 0: GRAPHQL_NAME@373..380 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@373..380 + 0: IDENT@373..380 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@380..380 5: (empty) 16: GRAPHQL_BOGUS_DEFINITION@380..399 - 0: GRAPHQL_NAME@380..390 "implemets" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@390..399 "Character" [] [] + 0: IDENT@380..390 "implemets" [] [Whitespace(" ")] + 1: IDENT@390..399 "Character" [] [] 17: GRAPHQL_OBJECT_TYPE_DEFINITION@399..447 0: (empty) 1: TYPE_KW@399..406 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@406..413 - 0: GRAPHQL_NAME@406..413 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@406..413 + 0: IDENT@406..413 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@413..439 0: IMPLEMENTS_KW@413..424 "implements" [] [Whitespace(" ")] 1: AMP@424..425 "&" [] [] 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@425..439 - 0: GRAPHQL_NAMED_TYPE@425..432 - 0: GRAPHQL_NAME@425..432 - 0: GRAPHQL_NAME@425..432 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@425..432 + 0: IDENT@425..432 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: (empty) - 2: GRAPHQL_NAMED_TYPE@432..439 - 0: GRAPHQL_NAME@432..439 - 0: GRAPHQL_NAME@432..439 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@432..439 + 0: IDENT@432..439 "Person" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@439..447 0: GRAPHQL_DIRECTIVE@439..447 0: AT@439..440 "@" [] [] - 1: GRAPHQL_NAME@440..447 - 0: GRAPHQL_NAME@440..447 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@440..447 + 0: IDENT@440..447 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: (empty) 5: (empty) 18: GRAPHQL_BOGUS_DEFINITION@447..474 - 0: GRAPHQL_NAME@447..454 "Person" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@454..463 "implents" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@463..473 "Character" [] [Whitespace(" ")] + 0: IDENT@447..454 "Person" [] [Whitespace(" ")] + 1: IDENT@454..463 "implents" [] [Whitespace(" ")] + 2: IDENT@463..473 "Character" [] [Whitespace(" ")] 3: AT@473..474 "@" [] [] 19: GRAPHQL_OBJECT_TYPE_DEFINITION@474..535 0: (empty) 1: TYPE_KW@474..481 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@481..488 - 0: GRAPHQL_NAME@481..488 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@481..488 + 0: IDENT@481..488 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@488..524 0: IMPLEMENTS_KW@488..499 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@499..524 - 0: GRAPHQL_NAMED_TYPE@499..509 - 0: GRAPHQL_NAME@499..509 - 0: GRAPHQL_NAME@499..509 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@499..509 + 0: IDENT@499..509 "Character" [] [Whitespace(" ")] 1: AMP@509..511 "&" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@511..522 - 0: GRAPHQL_NAME@511..522 - 0: GRAPHQL_NAME@511..522 "Character1" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@511..522 + 0: IDENT@511..522 "Character1" [] [Whitespace(" ")] 3: AMP@522..524 "&" [] [Whitespace(" ")] 4: (empty) 4: GRAPHQL_DIRECTIVE_LIST@524..535 0: GRAPHQL_DIRECTIVE@524..535 0: AT@524..525 "@" [] [] - 1: GRAPHQL_NAME@525..535 - 0: GRAPHQL_NAME@525..535 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@525..535 + 0: IDENT@525..535 "deprecated" [] [] 2: (empty) 5: (empty) 20: GRAPHQL_BOGUS_DEFINITION@535..804 0: TYPE_KW@535..542 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@542..549 - 0: GRAPHQL_NAME@542..549 "Person" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@542..549 + 0: IDENT@542..549 "Person" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@549..549 3: GRAPHQL_BOGUS@549..804 0: L_CURLY@549..550 "{" [] [] 1: GRAPHQL_BOGUS@550..802 0: GRAPHQL_FIELD_DEFINITION@550..578 0: (empty) - 1: GRAPHQL_NAME@550..557 - 0: GRAPHQL_NAME@550..557 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@550..557 + 0: IDENT@550..557 "name" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@557..570 0: L_PAREN@557..558 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@558..569 0: GRAPHQL_INPUT_VALUE_DEFINITION@558..569 0: (empty) - 1: GRAPHQL_NAME@558..568 - 0: GRAPHQL_NAME@558..568 "start_with" [] [] + 1: GRAPHQL_LITERAL_NAME@558..568 + 0: IDENT@558..568 "start_with" [] [] 2: COLON@568..569 ":" [] [] 3: (empty) 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@569..569 2: R_PAREN@569..570 ")" [] [] 3: COLON@570..572 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@572..578 - 0: GRAPHQL_NAME@572..578 - 0: GRAPHQL_NAME@572..578 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@572..578 + 0: IDENT@572..578 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@578..578 1: GRAPHQL_BOGUS@578..616 0: ERROR_TOKEN@578..616 "\"filder by age age: Int @deprecated" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_FIELD_DEFINITION@616..642 0: (empty) - 1: GRAPHQL_NAME@616..626 - 0: GRAPHQL_NAME@616..626 "picture" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@616..626 + 0: IDENT@616..626 "picture" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@626..637 0: L_PAREN@626..627 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@627..636 @@ -1047,9 +1000,8 @@ GraphqlRoot { 0: (empty) 1: (empty) 2: COLON@627..629 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@629..633 - 0: GRAPHQL_NAME@629..633 - 0: GRAPHQL_NAME@629..633 "Int" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@629..633 + 0: IDENT@629..633 "Int" [] [Whitespace(" ")] 4: GRAPHQL_DEFAULT_VALUE@633..636 0: EQ@633..635 "=" [] [Whitespace(" ")] 1: GRAPHQL_INT_VALUE@635..636 @@ -1057,14 +1009,13 @@ GraphqlRoot { 5: GRAPHQL_DIRECTIVE_LIST@636..636 2: R_PAREN@636..637 ")" [] [] 3: COLON@637..639 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@639..642 - 0: GRAPHQL_NAME@639..642 - 0: GRAPHQL_NAME@639..642 "Url" [] [] + 4: GRAPHQL_NAME_REFERENCE@639..642 + 0: IDENT@639..642 "Url" [] [] 5: GRAPHQL_DIRECTIVE_LIST@642..642 3: GRAPHQL_FIELD_DEFINITION@642..702 0: (empty) - 1: GRAPHQL_NAME@642..651 - 0: GRAPHQL_NAME@642..651 "height" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@642..651 + 0: IDENT@642..651 "height" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@651..697 0: L_PAREN@651..652 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@652..696 @@ -1072,27 +1023,26 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@652..671 0: GRAPHQL_STRING_VALUE@652..671 0: GRAPHQL_STRING_LITERAL@652..671 "\"filter by height\"" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@671..683 - 0: GRAPHQL_NAME@671..683 "greater_than" [] [] + 1: GRAPHQL_LITERAL_NAME@671..683 + 0: IDENT@671..683 "greater_than" [] [] 2: COLON@683..685 ":" [] [Whitespace(" ")] 3: (empty) 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@685..696 0: GRAPHQL_DIRECTIVE@685..696 0: AT@685..686 "@" [] [] - 1: GRAPHQL_NAME@686..696 - 0: GRAPHQL_NAME@686..696 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@686..696 + 0: IDENT@686..696 "deprecated" [] [] 2: (empty) 2: R_PAREN@696..697 ")" [] [] 3: COLON@697..699 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@699..702 - 0: GRAPHQL_NAME@699..702 - 0: GRAPHQL_NAME@699..702 "Int" [] [] + 4: GRAPHQL_NAME_REFERENCE@699..702 + 0: IDENT@699..702 "Int" [] [] 5: GRAPHQL_DIRECTIVE_LIST@702..702 4: GRAPHQL_FIELD_DEFINITION@702..768 0: (empty) - 1: GRAPHQL_NAME@702..711 - 0: GRAPHQL_NAME@702..711 "weight" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@702..711 + 0: IDENT@702..711 "weight" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@711..763 0: L_PAREN@711..712 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@712..762 @@ -1100,49 +1050,45 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@712..731 0: GRAPHQL_STRING_VALUE@712..731 0: GRAPHQL_STRING_LITERAL@712..731 "\"filter by weight\"" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@731..743 - 0: GRAPHQL_NAME@731..743 "greater_than" [] [] + 1: GRAPHQL_LITERAL_NAME@731..743 + 0: IDENT@731..743 "greater_than" [] [] 2: COLON@743..745 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@745..749 - 0: GRAPHQL_NAME@745..749 - 0: GRAPHQL_NAME@745..749 "Int" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@745..749 + 0: IDENT@745..749 "Int" [] [Whitespace(" ")] 4: GRAPHQL_DEFAULT_VALUE@749..751 0: EQ@749..751 "=" [] [Whitespace(" ")] 1: (empty) 5: GRAPHQL_DIRECTIVE_LIST@751..762 0: GRAPHQL_DIRECTIVE@751..762 0: AT@751..752 "@" [] [] - 1: GRAPHQL_NAME@752..762 - 0: GRAPHQL_NAME@752..762 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@752..762 + 0: IDENT@752..762 "deprecated" [] [] 2: (empty) 2: R_PAREN@762..763 ")" [] [] 3: COLON@763..765 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@765..768 - 0: GRAPHQL_NAME@765..768 - 0: GRAPHQL_NAME@765..768 "Int" [] [] + 4: GRAPHQL_NAME_REFERENCE@765..768 + 0: IDENT@765..768 "Int" [] [] 5: GRAPHQL_DIRECTIVE_LIST@768..768 5: GRAPHQL_FIELD_DEFINITION@768..802 0: (empty) - 1: GRAPHQL_NAME@768..775 - 0: GRAPHQL_NAME@768..775 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@768..775 + 0: IDENT@768..775 "name" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@775..794 0: L_PAREN@775..776 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@776..793 0: GRAPHQL_INPUT_VALUE_DEFINITION@776..793 0: (empty) - 1: GRAPHQL_NAME@776..787 - 0: GRAPHQL_NAME@776..787 "start_with" [] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@776..787 + 0: IDENT@776..787 "start_with" [] [Whitespace(" ")] 2: (empty) - 3: GRAPHQL_NAMED_TYPE@787..793 - 0: GRAPHQL_NAME@787..793 - 0: GRAPHQL_NAME@787..793 "String" [] [] + 3: GRAPHQL_NAME_REFERENCE@787..793 + 0: IDENT@787..793 "String" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@793..793 2: R_PAREN@793..794 ")" [] [] 3: COLON@794..796 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@796..802 - 0: GRAPHQL_NAME@796..802 - 0: GRAPHQL_NAME@796..802 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@796..802 + 0: IDENT@796..802 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@802..802 2: R_CURLY@802..804 "}" [Newline("\n")] [] 2: EOF@804..806 "" [Newline("\n"), Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/object_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/object_extension.graphql.snap index db75e3e9a2c1..e556333f8a23 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/object_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/object_extension.graphql.snap @@ -21,8 +21,8 @@ GraphqlRoot { GraphqlObjectTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], type_token: TYPE_KW@7..12 "type" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@12..17 "Story" [] [], + name: GraphqlNameReference { + value_token: IDENT@12..17 "Story" [] [], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -31,8 +31,8 @@ GraphqlRoot { GraphqlObjectTypeExtension { extend_token: EXTEND_KW@17..26 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], type_token: TYPE_KW@26..31 "type" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@31..35 "User" [] [], + name: GraphqlNameReference { + value_token: IDENT@31..35 "User" [] [], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -41,15 +41,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@35..42 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@35..42 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@42..44 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@44..50 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@44..50 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -71,16 +69,16 @@ GraphqlRoot { 0: GRAPHQL_OBJECT_TYPE_EXTENSION@0..17 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: TYPE_KW@7..12 "type" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@12..17 - 0: GRAPHQL_NAME@12..17 "Story" [] [] + 2: GRAPHQL_NAME_REFERENCE@12..17 + 0: IDENT@12..17 "Story" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@17..17 5: (empty) 1: GRAPHQL_OBJECT_TYPE_EXTENSION@17..52 0: EXTEND_KW@17..26 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: TYPE_KW@26..31 "type" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@31..35 - 0: GRAPHQL_NAME@31..35 "User" [] [] + 2: GRAPHQL_NAME_REFERENCE@31..35 + 0: IDENT@31..35 "User" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@35..35 5: GRAPHQL_FIELDS_DEFINITION@35..52 @@ -88,13 +86,12 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@35..50 0: GRAPHQL_FIELD_DEFINITION@35..50 0: (empty) - 1: GRAPHQL_NAME@35..42 - 0: GRAPHQL_NAME@35..42 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@35..42 + 0: IDENT@35..42 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@42..44 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@44..50 - 0: GRAPHQL_NAME@44..50 - 0: GRAPHQL_NAME@44..50 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@44..50 + 0: IDENT@44..50 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@50..50 2: R_CURLY@50..52 "}" [Newline("\n")] [] 2: EOF@52..53 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/scalar_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/scalar_extension.graphql.snap index 95194b112661..33b617ed75ee 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/scalar_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/scalar_extension.graphql.snap @@ -17,8 +17,8 @@ GraphqlRoot { GraphqlScalarTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], scalar_token: SCALAR_KW@7..14 "scalar" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@14..18 "Date" [] [], + name: GraphqlNameReference { + value_token: IDENT@14..18 "Date" [] [], }, directives: GraphqlDirectiveList [], }, @@ -36,8 +36,8 @@ GraphqlRoot { 0: GRAPHQL_SCALAR_TYPE_EXTENSION@0..18 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: SCALAR_KW@7..14 "scalar" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@14..18 - 0: GRAPHQL_NAME@14..18 "Date" [] [] + 2: GRAPHQL_NAME_REFERENCE@14..18 + 0: IDENT@14..18 "Date" [] [] 3: GRAPHQL_DIRECTIVE_LIST@18..18 2: EOF@18..19 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/schema.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/schema.graphql.snap index 576b04f3588c..68e031b558d4 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/schema.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/schema.graphql.snap @@ -49,54 +49,44 @@ GraphqlRoot { items: [ GraphqlBogus { items: [ - GRAPHQL_NAME@8..15 "quer" [Newline("\n"), Whitespace(" ")] [], + IDENT@8..15 "quer" [Newline("\n"), Whitespace(" ")] [], COLON@15..17 ":" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@17..32 "MyQueryRootType" [] [], - }, + GraphqlNameReference { + value_token: IDENT@17..32 "MyQueryRootType" [] [], }, ], }, GraphqlBogus { items: [ - GRAPHQL_NAME@32..42 "mutatio" [Newline("\n"), Whitespace(" ")] [], + IDENT@32..42 "mutatio" [Newline("\n"), Whitespace(" ")] [], COLON@42..44 ":" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@44..62 "MyMutationRootType" [] [], - }, + GraphqlNameReference { + value_token: IDENT@44..62 "MyMutationRootType" [] [], }, ], }, GraphqlBogus { items: [ - GRAPHQL_NAME@62..75 "subscriptio" [Newline("\n"), Whitespace("\t")] [], + IDENT@62..75 "subscriptio" [Newline("\n"), Whitespace("\t")] [], COLON@75..77 ":" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@77..99 "MySubscriptionRootType" [] [], - }, + GraphqlNameReference { + value_token: IDENT@77..99 "MySubscriptionRootType" [] [], }, ], }, GraphqlRootOperationTypeDefinition { operation_type: missing (required), colon_token: COLON@99..103 ":" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@103..125 "MySubscriptionRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@103..125 "MySubscriptionRootType" [] [], }, }, GraphqlBogus { items: [ GRAPHQL_INT_LITERAL@125..128 "8" [Newline("\n"), Whitespace("\t")] [], COLON@128..130 ":" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@130..152 "MySubscriptionRootType" [] [], - }, + GraphqlNameReference { + value_token: IDENT@130..152 "MySubscriptionRootType" [] [], }, ], }, @@ -118,7 +108,7 @@ GraphqlRoot { items: [ GraphqlBogus { items: [ - GRAPHQL_NAME@164..171 "quer" [Newline("\n"), Whitespace(" ")] [], + IDENT@164..171 "quer" [Newline("\n"), Whitespace(" ")] [], COLON@171..172 ":" [] [], ], }, @@ -132,7 +122,7 @@ GraphqlRoot { GraphqlBogusDefinition { items: [ ERROR_TOKEN@174..189 "\"sth schema {" [Newline("\n"), Newline("\n")] [], - GRAPHQL_NAME@189..196 "quer" [Newline("\n"), Whitespace(" ")] [], + IDENT@189..196 "quer" [Newline("\n"), Whitespace(" ")] [], COLON@196..197 ":" [] [], R_CURLY@197..199 "}" [Newline("\n")] [], ], @@ -149,10 +139,8 @@ GraphqlRoot { value_token: QUERY_KW@209..217 "query" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@217..219 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@219..234 "MyQueryRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@219..234 "MyQueryRootType" [] [], }, }, ], @@ -171,10 +159,8 @@ GraphqlRoot { value_token: QUERY_KW@244..252 "query" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@252..254 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@254..269 "MyQueryRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@254..269 "MyQueryRootType" [] [], }, }, ], @@ -185,8 +171,8 @@ GraphqlRoot { ty: GraphqlOperationType { value_token: QUERY_KW@269..277 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@277..293 "MyQueryRootType" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@277..293 "MyQueryRootType" [] [Whitespace(" ")], }, variables: missing (optional), directives: GraphqlDirectiveList [], @@ -195,13 +181,13 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@294..301 "field" [Newline("\n"), Whitespace("\t")] [], + value: GraphqlLiteralName { + value_token: IDENT@294..301 "field" [Newline("\n"), Whitespace("\t")] [], }, colon_token: COLON@301..303 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@303..309 "String" [] [], + name: GraphqlLiteralName { + value_token: IDENT@303..309 "String" [] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -229,35 +215,30 @@ GraphqlRoot { 0: L_CURLY@7..8 "{" [] [] 1: GRAPHQL_BOGUS@8..152 0: GRAPHQL_BOGUS@8..32 - 0: GRAPHQL_NAME@8..15 "quer" [Newline("\n"), Whitespace(" ")] [] + 0: IDENT@8..15 "quer" [Newline("\n"), Whitespace(" ")] [] 1: COLON@15..17 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@17..32 - 0: GRAPHQL_NAME@17..32 - 0: GRAPHQL_NAME@17..32 "MyQueryRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@17..32 + 0: IDENT@17..32 "MyQueryRootType" [] [] 1: GRAPHQL_BOGUS@32..62 - 0: GRAPHQL_NAME@32..42 "mutatio" [Newline("\n"), Whitespace(" ")] [] + 0: IDENT@32..42 "mutatio" [Newline("\n"), Whitespace(" ")] [] 1: COLON@42..44 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@44..62 - 0: GRAPHQL_NAME@44..62 - 0: GRAPHQL_NAME@44..62 "MyMutationRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@44..62 + 0: IDENT@44..62 "MyMutationRootType" [] [] 2: GRAPHQL_BOGUS@62..99 - 0: GRAPHQL_NAME@62..75 "subscriptio" [Newline("\n"), Whitespace("\t")] [] + 0: IDENT@62..75 "subscriptio" [Newline("\n"), Whitespace("\t")] [] 1: COLON@75..77 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@77..99 - 0: GRAPHQL_NAME@77..99 - 0: GRAPHQL_NAME@77..99 "MySubscriptionRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@77..99 + 0: IDENT@77..99 "MySubscriptionRootType" [] [] 3: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@99..125 0: (empty) 1: COLON@99..103 ":" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@103..125 - 0: GRAPHQL_NAME@103..125 - 0: GRAPHQL_NAME@103..125 "MySubscriptionRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@103..125 + 0: IDENT@103..125 "MySubscriptionRootType" [] [] 4: GRAPHQL_BOGUS@125..152 0: GRAPHQL_INT_LITERAL@125..128 "8" [Newline("\n"), Whitespace("\t")] [] 1: COLON@128..130 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@130..152 - 0: GRAPHQL_NAME@130..152 - 0: GRAPHQL_NAME@130..152 "MySubscriptionRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@130..152 + 0: IDENT@130..152 "MySubscriptionRootType" [] [] 2: R_CURLY@152..154 "}" [Newline("\n")] [] 1: GRAPHQL_BOGUS_DEFINITION@154..174 0: SCHEMA_KW@154..163 "schema" [Newline("\n"), Newline("\n")] [Whitespace(" ")] @@ -266,12 +247,12 @@ GraphqlRoot { 0: L_CURLY@163..164 "{" [] [] 1: GRAPHQL_BOGUS@164..172 0: GRAPHQL_BOGUS@164..172 - 0: GRAPHQL_NAME@164..171 "quer" [Newline("\n"), Whitespace(" ")] [] + 0: IDENT@164..171 "quer" [Newline("\n"), Whitespace(" ")] [] 1: COLON@171..172 ":" [] [] 2: R_CURLY@172..174 "}" [Newline("\n")] [] 2: GRAPHQL_BOGUS_DEFINITION@174..199 0: ERROR_TOKEN@174..189 "\"sth schema {" [Newline("\n"), Newline("\n")] [] - 1: GRAPHQL_NAME@189..196 "quer" [Newline("\n"), Whitespace(" ")] [] + 1: IDENT@189..196 "quer" [Newline("\n"), Whitespace(" ")] [] 2: COLON@196..197 ":" [] [] 3: R_CURLY@197..199 "}" [Newline("\n")] [] 3: GRAPHQL_SCHEMA_DEFINITION@199..234 @@ -285,9 +266,8 @@ GraphqlRoot { 0: GRAPHQL_OPERATION_TYPE@209..217 0: QUERY_KW@209..217 "query" [Newline("\n"), Whitespace(" ")] [] 1: COLON@217..219 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@219..234 - 0: GRAPHQL_NAME@219..234 - 0: GRAPHQL_NAME@219..234 "MyQueryRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@219..234 + 0: IDENT@219..234 "MyQueryRootType" [] [] 2: (empty) 4: GRAPHQL_SCHEMA_DEFINITION@234..269 0: (empty) @@ -300,15 +280,14 @@ GraphqlRoot { 0: GRAPHQL_OPERATION_TYPE@244..252 0: QUERY_KW@244..252 "query" [Newline("\n"), Whitespace(" ")] [] 1: COLON@252..254 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@254..269 - 0: GRAPHQL_NAME@254..269 - 0: GRAPHQL_NAME@254..269 "MyQueryRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@254..269 + 0: IDENT@254..269 "MyQueryRootType" [] [] 2: (empty) 5: GRAPHQL_OPERATION_DEFINITION@269..311 0: GRAPHQL_OPERATION_TYPE@269..277 0: QUERY_KW@269..277 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@277..293 - 0: GRAPHQL_NAME@277..293 "MyQueryRootType" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@277..293 + 0: IDENT@277..293 "MyQueryRootType" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@293..293 4: GRAPHQL_SELECTION_SET@293..311 @@ -316,11 +295,11 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@294..309 0: GRAPHQL_FIELD@294..309 0: GRAPHQL_ALIAS@294..303 - 0: GRAPHQL_NAME@294..301 - 0: GRAPHQL_NAME@294..301 "field" [Newline("\n"), Whitespace("\t")] [] + 0: GRAPHQL_LITERAL_NAME@294..301 + 0: IDENT@294..301 "field" [Newline("\n"), Whitespace("\t")] [] 1: COLON@301..303 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@303..309 - 0: GRAPHQL_NAME@303..309 "String" [] [] + 1: GRAPHQL_LITERAL_NAME@303..309 + 0: IDENT@303..309 "String" [] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@309..309 4: (empty) diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/schema_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/schema_extension.graphql.snap index 833c9a9af17e..45fca9dbb447 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/schema_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/schema_extension.graphql.snap @@ -39,10 +39,8 @@ GraphqlRoot { value_token: QUERY_KW@28..36 "query" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@36..38 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@38..53 "MyQueryRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@38..53 "MyQueryRootType" [] [], }, }, GraphqlRootOperationTypeDefinition { @@ -50,10 +48,8 @@ GraphqlRoot { value_token: MUTATION_KW@53..64 "mutation" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@64..66 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@66..84 "MyMutationRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@66..84 "MyMutationRootType" [] [], }, }, GraphqlRootOperationTypeDefinition { @@ -61,10 +57,8 @@ GraphqlRoot { value_token: SUBSCRIPTION_KW@84..99 "subscription" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@99..101 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@101..123 "MySubscriptionRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@101..123 "MySubscriptionRootType" [] [], }, }, ], @@ -98,23 +92,20 @@ GraphqlRoot { 0: GRAPHQL_OPERATION_TYPE@28..36 0: QUERY_KW@28..36 "query" [Newline("\n"), Whitespace(" ")] [] 1: COLON@36..38 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@38..53 - 0: GRAPHQL_NAME@38..53 - 0: GRAPHQL_NAME@38..53 "MyQueryRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@38..53 + 0: IDENT@38..53 "MyQueryRootType" [] [] 1: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@53..84 0: GRAPHQL_OPERATION_TYPE@53..64 0: MUTATION_KW@53..64 "mutation" [Newline("\n"), Whitespace(" ")] [] 1: COLON@64..66 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@66..84 - 0: GRAPHQL_NAME@66..84 - 0: GRAPHQL_NAME@66..84 "MyMutationRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@66..84 + 0: IDENT@66..84 "MyMutationRootType" [] [] 2: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@84..123 0: GRAPHQL_OPERATION_TYPE@84..99 0: SUBSCRIPTION_KW@84..99 "subscription" [Newline("\n"), Whitespace(" ")] [] 1: COLON@99..101 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@101..123 - 0: GRAPHQL_NAME@101..123 - 0: GRAPHQL_NAME@101..123 "MySubscriptionRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@101..123 + 0: IDENT@101..123 "MySubscriptionRootType" [] [] 2: R_CURLY@123..125 "}" [Newline("\n")] [] 2: EOF@125..127 "" [Newline("\n"), Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/union.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/union.graphql.snap index 8363404e42bb..0c220ce6ebd1 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/union.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/union.graphql.snap @@ -40,18 +40,16 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@0..6 "union" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@6..19 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@6..19 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], union_members: GraphqlUnionMemberTypes { eq_token: EQ@19..21 "=" [] [Whitespace(" ")], bitwise_or_token: missing (optional), members: GraphqlUnionMemberTypeList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@21..27 "Photo" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@21..27 "Photo" [] [Whitespace(" ")], }, PIPE@27..28 "|" [] [], missing element, @@ -61,24 +59,20 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@28..36 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@36..48 "SearchResult" [] [], + name: GraphqlNameBinding { + value_token: IDENT@36..48 "SearchResult" [] [], }, directives: GraphqlDirectiveList [], union_members: GraphqlUnionMemberTypes { eq_token: missing (required), bitwise_or_token: PIPE@48..52 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], members: GraphqlUnionMemberTypeList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@52..57 "Photo" [] [], - }, + GraphqlNameReference { + value_token: IDENT@52..57 "Photo" [] [], }, PIPE@57..61 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@61..67 "Person" [] [], - }, + GraphqlNameReference { + value_token: IDENT@61..67 "Person" [] [], }, ], }, @@ -86,8 +80,8 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@67..75 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@75..88 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@75..88 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], union_members: GraphqlUnionMemberTypes { @@ -96,10 +90,8 @@ GraphqlRoot { members: GraphqlUnionMemberTypeList [ missing element, PIPE@92..96 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@96..102 "Person" [] [], - }, + GraphqlNameReference { + value_token: IDENT@96..102 "Person" [] [], }, ], }, @@ -107,30 +99,24 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@102..110 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@110..123 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@110..123 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], union_members: GraphqlUnionMemberTypes { eq_token: EQ@123..124 "=" [] [], bitwise_or_token: PIPE@124..128 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], members: GraphqlUnionMemberTypeList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@128..133 "Photo" [] [], - }, + GraphqlNameReference { + value_token: IDENT@128..133 "Photo" [] [], }, missing separator, - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@133..143 "Person" [Newline("\n"), Whitespace("\t ")] [], - }, + GraphqlNameReference { + value_token: IDENT@133..143 "Person" [Newline("\n"), Whitespace("\t ")] [], }, PIPE@143..147 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@147..152 "union" [] [], - }, + GraphqlNameReference { + value_token: IDENT@147..152 "union" [] [], }, ], }, @@ -138,14 +124,14 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@152..160 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@160..173 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@160..173 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@173..174 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@174..182 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@174..182 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -154,10 +140,8 @@ GraphqlRoot { eq_token: missing (required), bitwise_or_token: missing (optional), members: GraphqlUnionMemberTypeList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@182..195 "SearchResult" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@182..195 "SearchResult" [] [Whitespace(" ")], }, PIPE@195..196 "|" [] [], missing element, @@ -167,8 +151,8 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@196..204 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@204..217 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@204..217 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], union_members: GraphqlUnionMemberTypes { @@ -180,8 +164,8 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@218..226 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@226..239 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@226..239 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], union_members: GraphqlUnionMemberTypes { @@ -193,8 +177,8 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@242..250 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@250..263 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@250..263 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { @@ -223,40 +207,37 @@ GraphqlRoot { 0: GRAPHQL_UNION_TYPE_DEFINITION@0..28 0: (empty) 1: UNION_KW@0..6 "union" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@6..19 - 0: GRAPHQL_NAME@6..19 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@6..19 + 0: IDENT@6..19 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@19..19 4: GRAPHQL_UNION_MEMBER_TYPES@19..28 0: EQ@19..21 "=" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_UNION_MEMBER_TYPE_LIST@21..28 - 0: GRAPHQL_NAMED_TYPE@21..27 - 0: GRAPHQL_NAME@21..27 - 0: GRAPHQL_NAME@21..27 "Photo" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@21..27 + 0: IDENT@21..27 "Photo" [] [Whitespace(" ")] 1: PIPE@27..28 "|" [] [] 2: (empty) 1: GRAPHQL_UNION_TYPE_DEFINITION@28..67 0: (empty) 1: UNION_KW@28..36 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@36..48 - 0: GRAPHQL_NAME@36..48 "SearchResult" [] [] + 2: GRAPHQL_NAME_BINDING@36..48 + 0: IDENT@36..48 "SearchResult" [] [] 3: GRAPHQL_DIRECTIVE_LIST@48..48 4: GRAPHQL_UNION_MEMBER_TYPES@48..67 0: (empty) 1: PIPE@48..52 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 2: GRAPHQL_UNION_MEMBER_TYPE_LIST@52..67 - 0: GRAPHQL_NAMED_TYPE@52..57 - 0: GRAPHQL_NAME@52..57 - 0: GRAPHQL_NAME@52..57 "Photo" [] [] + 0: GRAPHQL_NAME_REFERENCE@52..57 + 0: IDENT@52..57 "Photo" [] [] 1: PIPE@57..61 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@61..67 - 0: GRAPHQL_NAME@61..67 - 0: GRAPHQL_NAME@61..67 "Person" [] [] + 2: GRAPHQL_NAME_REFERENCE@61..67 + 0: IDENT@61..67 "Person" [] [] 2: GRAPHQL_UNION_TYPE_DEFINITION@67..102 0: (empty) 1: UNION_KW@67..75 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@75..88 - 0: GRAPHQL_NAME@75..88 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@75..88 + 0: IDENT@75..88 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@88..88 4: GRAPHQL_UNION_MEMBER_TYPES@88..102 0: EQ@88..89 "=" [] [] @@ -264,55 +245,50 @@ GraphqlRoot { 2: GRAPHQL_UNION_MEMBER_TYPE_LIST@92..102 0: (empty) 1: PIPE@92..96 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@96..102 - 0: GRAPHQL_NAME@96..102 - 0: GRAPHQL_NAME@96..102 "Person" [] [] + 2: GRAPHQL_NAME_REFERENCE@96..102 + 0: IDENT@96..102 "Person" [] [] 3: GRAPHQL_UNION_TYPE_DEFINITION@102..152 0: (empty) 1: UNION_KW@102..110 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@110..123 - 0: GRAPHQL_NAME@110..123 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@110..123 + 0: IDENT@110..123 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@123..123 4: GRAPHQL_UNION_MEMBER_TYPES@123..152 0: EQ@123..124 "=" [] [] 1: PIPE@124..128 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 2: GRAPHQL_UNION_MEMBER_TYPE_LIST@128..152 - 0: GRAPHQL_NAMED_TYPE@128..133 - 0: GRAPHQL_NAME@128..133 - 0: GRAPHQL_NAME@128..133 "Photo" [] [] + 0: GRAPHQL_NAME_REFERENCE@128..133 + 0: IDENT@128..133 "Photo" [] [] 1: (empty) - 2: GRAPHQL_NAMED_TYPE@133..143 - 0: GRAPHQL_NAME@133..143 - 0: GRAPHQL_NAME@133..143 "Person" [Newline("\n"), Whitespace("\t ")] [] + 2: GRAPHQL_NAME_REFERENCE@133..143 + 0: IDENT@133..143 "Person" [Newline("\n"), Whitespace("\t ")] [] 3: PIPE@143..147 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@147..152 - 0: GRAPHQL_NAME@147..152 - 0: GRAPHQL_NAME@147..152 "union" [] [] + 4: GRAPHQL_NAME_REFERENCE@147..152 + 0: IDENT@147..152 "union" [] [] 4: GRAPHQL_UNION_TYPE_DEFINITION@152..196 0: (empty) 1: UNION_KW@152..160 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@160..173 - 0: GRAPHQL_NAME@160..173 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@160..173 + 0: IDENT@160..173 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@173..182 0: GRAPHQL_DIRECTIVE@173..182 0: AT@173..174 "@" [] [] - 1: GRAPHQL_NAME@174..182 - 0: GRAPHQL_NAME@174..182 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@174..182 + 0: IDENT@174..182 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_UNION_MEMBER_TYPES@182..196 0: (empty) 1: (empty) 2: GRAPHQL_UNION_MEMBER_TYPE_LIST@182..196 - 0: GRAPHQL_NAMED_TYPE@182..195 - 0: GRAPHQL_NAME@182..195 - 0: GRAPHQL_NAME@182..195 "SearchResult" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@182..195 + 0: IDENT@182..195 "SearchResult" [] [Whitespace(" ")] 1: PIPE@195..196 "|" [] [] 2: (empty) 5: GRAPHQL_UNION_TYPE_DEFINITION@196..218 0: (empty) 1: UNION_KW@196..204 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@204..217 - 0: GRAPHQL_NAME@204..217 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@204..217 + 0: IDENT@204..217 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@217..217 4: GRAPHQL_UNION_MEMBER_TYPES@217..218 0: EQ@217..218 "=" [] [] @@ -321,8 +297,8 @@ GraphqlRoot { 6: GRAPHQL_UNION_TYPE_DEFINITION@218..242 0: (empty) 1: UNION_KW@218..226 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@226..239 - 0: GRAPHQL_NAME@226..239 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@226..239 + 0: IDENT@226..239 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@239..239 4: GRAPHQL_UNION_MEMBER_TYPES@239..242 0: EQ@239..241 "=" [] [Whitespace(" ")] @@ -331,8 +307,8 @@ GraphqlRoot { 7: GRAPHQL_UNION_TYPE_DEFINITION@242..266 0: (empty) 1: UNION_KW@242..250 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@250..263 - 0: GRAPHQL_NAME@250..263 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@250..263 + 0: IDENT@250..263 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@263..265 0: GRAPHQL_DIRECTIVE@263..265 0: AT@263..265 "@" [] [Whitespace(" ")] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/union_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/union_extension.graphql.snap index e302aac35ce9..691dd6b68708 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/union_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/definitions/union_extension.graphql.snap @@ -19,8 +19,8 @@ GraphqlRoot { GraphqlUnionTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], union_token: UNION_KW@7..13 "union" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@13..25 "SearchResult" [] [], + name: GraphqlNameReference { + value_token: IDENT@13..25 "SearchResult" [] [], }, directives: GraphqlDirectiveList [], union_members: missing (optional), @@ -28,24 +28,20 @@ GraphqlRoot { GraphqlUnionTypeExtension { extend_token: EXTEND_KW@25..34 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], union_token: UNION_KW@34..40 "union" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@40..53 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@40..53 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], union_members: GraphqlUnionMemberTypes { eq_token: missing (required), bitwise_or_token: missing (optional), members: GraphqlUnionMemberTypeList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@53..59 "Photo" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@53..59 "Photo" [] [Whitespace(" ")], }, PIPE@59..61 "|" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@61..67 "Person" [] [], - }, + GraphqlNameReference { + value_token: IDENT@61..67 "Person" [] [], }, ], }, @@ -64,27 +60,25 @@ GraphqlRoot { 0: GRAPHQL_UNION_TYPE_EXTENSION@0..25 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: UNION_KW@7..13 "union" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@13..25 - 0: GRAPHQL_NAME@13..25 "SearchResult" [] [] + 2: GRAPHQL_NAME_REFERENCE@13..25 + 0: IDENT@13..25 "SearchResult" [] [] 3: GRAPHQL_DIRECTIVE_LIST@25..25 4: (empty) 1: GRAPHQL_UNION_TYPE_EXTENSION@25..67 0: EXTEND_KW@25..34 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: UNION_KW@34..40 "union" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@40..53 - 0: GRAPHQL_NAME@40..53 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@40..53 + 0: IDENT@40..53 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@53..53 4: GRAPHQL_UNION_MEMBER_TYPES@53..67 0: (empty) 1: (empty) 2: GRAPHQL_UNION_MEMBER_TYPE_LIST@53..67 - 0: GRAPHQL_NAMED_TYPE@53..59 - 0: GRAPHQL_NAME@53..59 - 0: GRAPHQL_NAME@53..59 "Photo" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@53..59 + 0: IDENT@53..59 "Photo" [] [Whitespace(" ")] 1: PIPE@59..61 "|" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@61..67 - 0: GRAPHQL_NAME@61..67 - 0: GRAPHQL_NAME@61..67 "Person" [] [] + 2: GRAPHQL_NAME_REFERENCE@61..67 + 0: IDENT@61..67 "Person" [] [] 2: EOF@67..68 "" [Newline("\n")] [] ``` diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/directive.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/directive.graphql.snap index 6eb04154127b..7287d12c6071 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/directive.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/directive.graphql.snap @@ -53,8 +53,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@1..9 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@1..9 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [ @@ -74,8 +74,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@15..23 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@15..23 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [ @@ -100,16 +100,16 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlBogusSelection { items: [ - GraphqlName { - value_token: GRAPHQL_NAME@31..39 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + GraphqlLiteralName { + value_token: IDENT@31..39 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, GraphqlBogus { items: [ GraphqlBogus { items: [ AT@39..40 "@" [] [], - GraphqlName { - value_token: GRAPHQL_NAME@40..50 "deprecated" [] [], + GraphqlNameReference { + value_token: IDENT@40..50 "deprecated" [] [], }, GraphqlBogus { items: [ @@ -141,22 +141,22 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@71..79 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@71..79 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@79..80 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@80..90 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@80..90 "deprecated" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@90..91 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@91..97 "reason" [] [], + name: GraphqlLiteralName { + value_token: IDENT@91..97 "reason" [] [], }, colon_token: COLON@97..98 ":" [] [], value: missing (required), @@ -176,16 +176,16 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlBogusSelection { items: [ - GraphqlName { - value_token: GRAPHQL_NAME@104..112 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + GraphqlLiteralName { + value_token: IDENT@104..112 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, GraphqlBogus { items: [ GraphqlBogus { items: [ AT@112..113 "@" [] [], - GraphqlName { - value_token: GRAPHQL_NAME@113..123 "deprecated" [] [], + GraphqlNameReference { + value_token: IDENT@113..123 "deprecated" [] [], }, GraphqlBogus { items: [ @@ -193,8 +193,8 @@ GraphqlRoot { GraphqlBogus { items: [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@124..130 "reason" [] [], + name: GraphqlLiteralName { + value_token: IDENT@124..130 "reason" [] [], }, colon_token: COLON@130..132 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -208,8 +208,8 @@ GraphqlRoot { ], }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@149..157 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@149..157 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, colon_token: missing (required), value: missing (required), @@ -229,8 +229,8 @@ GraphqlRoot { GraphqlBogus { items: [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@159..165 "reason" [] [], + name: GraphqlLiteralName { + value_token: IDENT@159..165 "reason" [] [], }, colon_token: COLON@165..167 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -244,8 +244,8 @@ GraphqlRoot { ], }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@184..192 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@184..192 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, colon_token: missing (required), value: missing (required), @@ -273,8 +273,8 @@ GraphqlRoot { ], }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@213..221 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@213..221 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, colon_token: missing (required), value: missing (required), @@ -301,8 +301,8 @@ GraphqlRoot { ], }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@229..237 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@229..237 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, colon_token: missing (required), value: missing (required), @@ -351,8 +351,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@1..10 0: GRAPHQL_FIELD@1..10 0: (empty) - 1: GRAPHQL_NAME@1..9 - 0: GRAPHQL_NAME@1..9 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@1..9 + 0: IDENT@1..9 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@9..10 0: GRAPHQL_DIRECTIVE@9..10 @@ -366,8 +366,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@15..26 0: GRAPHQL_FIELD@15..26 0: (empty) - 1: GRAPHQL_NAME@15..23 - 0: GRAPHQL_NAME@15..23 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@15..23 + 0: IDENT@15..23 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@23..26 0: GRAPHQL_DIRECTIVE@23..25 @@ -384,13 +384,13 @@ GraphqlRoot { 0: L_CURLY@28..31 "{" [Newline("\n"), Newline("\n")] [] 1: GRAPHQL_SELECTION_LIST@31..66 0: GRAPHQL_BOGUS_SELECTION@31..66 - 0: GRAPHQL_NAME@31..39 - 0: GRAPHQL_NAME@31..39 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 0: GRAPHQL_LITERAL_NAME@31..39 + 0: IDENT@31..39 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 1: GRAPHQL_BOGUS@39..66 0: GRAPHQL_BOGUS@39..66 0: AT@39..40 "@" [] [] - 1: GRAPHQL_NAME@40..50 - 0: GRAPHQL_NAME@40..50 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@40..50 + 0: IDENT@40..50 "deprecated" [] [] 2: GRAPHQL_BOGUS@50..66 0: L_PAREN@50..51 "(" [] [] 1: GRAPHQL_BOGUS@51..65 @@ -404,20 +404,20 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@71..99 0: GRAPHQL_FIELD@71..99 0: (empty) - 1: GRAPHQL_NAME@71..79 - 0: GRAPHQL_NAME@71..79 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@71..79 + 0: IDENT@71..79 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@79..99 0: GRAPHQL_DIRECTIVE@79..99 0: AT@79..80 "@" [] [] - 1: GRAPHQL_NAME@80..90 - 0: GRAPHQL_NAME@80..90 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@80..90 + 0: IDENT@80..90 "deprecated" [] [] 2: GRAPHQL_ARGUMENTS@90..99 0: L_PAREN@90..91 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@91..98 0: GRAPHQL_ARGUMENT@91..98 - 0: GRAPHQL_NAME@91..97 - 0: GRAPHQL_NAME@91..97 "reason" [] [] + 0: GRAPHQL_LITERAL_NAME@91..97 + 0: IDENT@91..97 "reason" [] [] 1: COLON@97..98 ":" [] [] 2: (empty) 2: R_PAREN@98..99 ")" [] [] @@ -427,19 +427,19 @@ GraphqlRoot { 0: L_CURLY@101..104 "{" [Newline("\n"), Newline("\n")] [] 1: GRAPHQL_SELECTION_LIST@104..241 0: GRAPHQL_BOGUS_SELECTION@104..241 - 0: GRAPHQL_NAME@104..112 - 0: GRAPHQL_NAME@104..112 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 0: GRAPHQL_LITERAL_NAME@104..112 + 0: IDENT@104..112 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 1: GRAPHQL_BOGUS@112..241 0: GRAPHQL_BOGUS@112..157 0: AT@112..113 "@" [] [] - 1: GRAPHQL_NAME@113..123 - 0: GRAPHQL_NAME@113..123 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@113..123 + 0: IDENT@113..123 "deprecated" [] [] 2: GRAPHQL_BOGUS@123..157 0: L_PAREN@123..124 "(" [] [] 1: GRAPHQL_BOGUS@124..157 0: GRAPHQL_ARGUMENT@124..144 - 0: GRAPHQL_NAME@124..130 - 0: GRAPHQL_NAME@124..130 "reason" [] [] + 0: GRAPHQL_LITERAL_NAME@124..130 + 0: IDENT@124..130 "reason" [] [] 1: COLON@130..132 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@132..144 0: GRAPHQL_STRING_LITERAL@132..144 "\"Deprecated\"" [] [] @@ -447,8 +447,8 @@ GraphqlRoot { 0: R_CURLY@144..146 "}" [Newline("\n")] [] 1: L_CURLY@146..149 "{" [Newline("\n"), Newline("\n")] [] 2: GRAPHQL_ARGUMENT@149..157 - 0: GRAPHQL_NAME@149..157 - 0: GRAPHQL_NAME@149..157 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 0: GRAPHQL_LITERAL_NAME@149..157 + 0: IDENT@149..157 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 1: (empty) 2: (empty) 1: GRAPHQL_BOGUS@157..192 @@ -457,8 +457,8 @@ GraphqlRoot { 0: L_PAREN@158..159 "(" [] [] 1: GRAPHQL_BOGUS@159..192 0: GRAPHQL_ARGUMENT@159..179 - 0: GRAPHQL_NAME@159..165 - 0: GRAPHQL_NAME@159..165 "reason" [] [] + 0: GRAPHQL_LITERAL_NAME@159..165 + 0: IDENT@159..165 "reason" [] [] 1: COLON@165..167 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@167..179 0: GRAPHQL_STRING_LITERAL@167..179 "\"Deprecated\"" [] [] @@ -466,8 +466,8 @@ GraphqlRoot { 0: R_CURLY@179..181 "}" [Newline("\n")] [] 1: L_CURLY@181..184 "{" [Newline("\n"), Newline("\n")] [] 2: GRAPHQL_ARGUMENT@184..192 - 0: GRAPHQL_NAME@184..192 - 0: GRAPHQL_NAME@184..192 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 0: GRAPHQL_LITERAL_NAME@184..192 + 0: IDENT@184..192 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 1: (empty) 2: (empty) 2: GRAPHQL_BOGUS@192..221 @@ -481,8 +481,8 @@ GraphqlRoot { 2: R_CURLY@208..210 "}" [Newline("\n")] [] 3: L_CURLY@210..213 "{" [Newline("\n"), Newline("\n")] [] 1: GRAPHQL_ARGUMENT@213..221 - 0: GRAPHQL_NAME@213..221 - 0: GRAPHQL_NAME@213..221 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 0: GRAPHQL_LITERAL_NAME@213..221 + 0: IDENT@213..221 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 1: (empty) 2: (empty) 3: GRAPHQL_BOGUS@221..237 @@ -495,8 +495,8 @@ GraphqlRoot { 1: R_CURLY@224..226 "}" [Newline("\n")] [] 2: L_CURLY@226..229 "{" [Newline("\n"), Newline("\n")] [] 1: GRAPHQL_ARGUMENT@229..237 - 0: GRAPHQL_NAME@229..237 - 0: GRAPHQL_NAME@229..237 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 0: GRAPHQL_LITERAL_NAME@229..237 + 0: IDENT@229..237 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 1: (empty) 2: (empty) 4: GRAPHQL_DIRECTIVE@237..241 diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/operation.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/operation.graphql.snap index cfd742b13993..11ac39c03d32 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/operation.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/operation.graphql.snap @@ -98,8 +98,8 @@ GraphqlRoot { ty: GraphqlOperationType { value_token: QUERY_KW@0..6 "query" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@6..16 "likeStory" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@6..16 "likeStory" [] [Whitespace(" ")], }, variables: missing (optional), directives: GraphqlDirectiveList [], @@ -113,8 +113,8 @@ GraphqlRoot { ty: GraphqlOperationType { value_token: QUERY_KW@17..25 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@25..34 "likeStory" [] [], + name: GraphqlNameBinding { + value_token: IDENT@25..34 "likeStory" [] [], }, variables: missing (optional), directives: GraphqlDirectiveList [], @@ -123,8 +123,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@34..42 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@34..42 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -143,18 +143,16 @@ GraphqlRoot { l_paren_token: L_PAREN@73..74 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@74..75 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@75..82 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@75..82 "storyId" [] [], }, }, colon_token: COLON@82..84 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@84..86 "ID" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@84..86 "ID" [] [], }, excl_token: BANG@86..88 "!" [] [Whitespace(" ")], }, @@ -170,21 +168,21 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@89..100 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@89..100 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@100..101 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@101..108 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@101..108 "storyId" [] [], }, colon_token: COLON@108..110 ":" [] [Whitespace(" ")], - value: GraphqlVariable { + value: GraphqlVariableReference { dollar_token: DOLLAR@110..111 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@111..118 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@111..118 "storyId" [] [], }, }, }, @@ -207,18 +205,16 @@ GraphqlRoot { l_paren_token: missing (required), elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@129..130 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@130..137 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@130..137 "storyId" [] [], }, }, colon_token: COLON@137..139 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@139..141 "ID" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@139..141 "ID" [] [], }, excl_token: BANG@141..143 "!" [] [Whitespace(" ")], }, @@ -234,21 +230,21 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@144..155 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@144..155 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@155..156 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@156..163 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@156..163 "storyId" [] [], }, colon_token: COLON@163..165 ":" [] [Whitespace(" ")], - value: GraphqlVariable { + value: GraphqlVariableReference { dollar_token: DOLLAR@165..166 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@166..173 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@166..173 "storyId" [] [], }, }, }, @@ -271,18 +267,16 @@ GraphqlRoot { l_paren_token: missing (required), elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@184..185 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@185..192 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@185..192 "storyId" [] [], }, }, colon_token: COLON@192..194 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@194..196 "ID" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@194..196 "ID" [] [], }, excl_token: BANG@196..197 "!" [] [], }, @@ -298,21 +292,21 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@200..211 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@200..211 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@211..212 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@212..219 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@212..219 "storyId" [] [], }, colon_token: COLON@219..221 ":" [] [Whitespace(" ")], - value: GraphqlVariable { + value: GraphqlVariableReference { dollar_token: DOLLAR@221..222 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@222..229 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@222..229 "storyId" [] [], }, }, }, @@ -335,7 +329,7 @@ GraphqlRoot { l_paren_token: L_PAREN@240..241 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@241..242 "$" [] [], name: missing (required), }, @@ -353,18 +347,18 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@247..258 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@247..258 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@258..259 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@259..266 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@259..266 "storyId" [] [], }, colon_token: COLON@266..268 ":" [] [Whitespace(" ")], - value: GraphqlVariable { + value: GraphqlVariableReference { dollar_token: DOLLAR@268..269 "$" [] [], name: missing (required), }, @@ -391,7 +385,7 @@ GraphqlRoot { items: [ GraphqlBogus { items: [ - GRAPHQL_NAME@281..282 "a" [] [], + IDENT@281..282 "a" [] [], COLON@282..284 ":" [] [Whitespace(" ")], GraphqlDirectiveList [], ], @@ -407,8 +401,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@287..298 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@287..298 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -431,7 +425,7 @@ GraphqlRoot { items: [ GraphqlBogus { items: [ - GRAPHQL_NAME@309..310 "a" [] [], + IDENT@309..310 "a" [] [], COLON@310..313 ":" [] [Whitespace(" ")], GraphqlDirectiveList [], ], @@ -446,8 +440,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@314..325 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@314..325 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -482,8 +476,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@341..352 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@341..352 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -517,8 +511,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@367..378 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@367..378 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -552,8 +546,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@392..403 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@392..403 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -579,8 +573,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@417..428 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@417..428 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -599,10 +593,10 @@ GraphqlRoot { l_paren_token: L_PAREN@438..439 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@439..440 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@440..447 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@440..447 "storyId" [] [], }, }, colon_token: COLON@447..449 ":" [] [Whitespace(" ")], @@ -628,8 +622,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@454..465 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@454..465 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -654,8 +648,8 @@ GraphqlRoot { value: missing (required), colon_token: COLON@495..499 ":" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@499..508 "likeStory" [] [], + name: GraphqlLiteralName { + value_token: IDENT@499..508 "likeStory" [] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -677,8 +671,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@541..553 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@541..553 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -686,8 +680,8 @@ GraphqlRoot { }, GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@553..560 "storyId" [] [], + value: GraphqlLiteralName { + value_token: IDENT@553..560 "storyId" [] [], }, colon_token: COLON@560..562 ":" [] [Whitespace(" ")], }, @@ -703,8 +697,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@563..570 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@563..570 "storyId" [] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -728,18 +722,16 @@ GraphqlRoot { l_paren_token: L_PAREN@581..582 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@582..583 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@583..590 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@583..590 "storyId" [] [], }, }, colon_token: COLON@590..592 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@592..594 "ID" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@592..594 "ID" [] [], }, excl_token: BANG@594..595 "!" [] [], }, @@ -755,21 +747,21 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@598..609 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@598..609 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@609..610 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@610..617 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@610..617 "storyId" [] [], }, colon_token: COLON@617..619 ":" [] [Whitespace(" ")], - value: GraphqlVariable { + value: GraphqlVariableReference { dollar_token: DOLLAR@619..620 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@620..627 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@620..627 "storyId" [] [], }, }, }, @@ -792,18 +784,16 @@ GraphqlRoot { l_paren_token: L_PAREN@638..639 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@639..640 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@640..647 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@640..647 "storyId" [] [], }, }, colon_token: COLON@647..649 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@649..651 "ID" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@649..651 "ID" [] [], }, excl_token: BANG@651..652 "!" [] [], }, @@ -819,8 +809,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@656..668 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@656..668 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -828,8 +818,8 @@ GraphqlRoot { }, GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@668..675 "storyId" [] [], + value: GraphqlLiteralName { + value_token: IDENT@668..675 "storyId" [] [], }, colon_token: COLON@675..677 ":" [] [Whitespace(" ")], }, @@ -845,8 +835,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@678..685 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@678..685 "storyId" [] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -865,18 +855,16 @@ GraphqlRoot { l_paren_token: L_PAREN@695..696 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@696..697 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@697..704 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@697..704 "storyId" [] [], }, }, colon_token: COLON@704..706 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@706..708 "ID" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@706..708 "ID" [] [], }, excl_token: BANG@708..709 "!" [] [], }, @@ -892,8 +880,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@712..724 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@712..724 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -901,8 +889,8 @@ GraphqlRoot { }, GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@724..731 "storyId" [] [], + value: GraphqlLiteralName { + value_token: IDENT@724..731 "storyId" [] [], }, colon_token: COLON@731..733 ":" [] [Whitespace(" ")], }, @@ -931,7 +919,7 @@ GraphqlRoot { GraphqlBogus { items: [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@745..746 "$" [] [], name: missing (required), }, @@ -968,8 +956,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@757..768 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@757..768 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -989,18 +977,16 @@ GraphqlRoot { l_paren_token: L_PAREN@801..802 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@802..803 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@803..810 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@803..810 "storyId" [] [], }, }, colon_token: COLON@810..812 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@812..814 "ID" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@812..814 "ID" [] [], }, excl_token: BANG@814..815 "!" [] [], }, @@ -1022,8 +1008,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@820..831 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@820..831 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -1047,8 +1033,8 @@ GraphqlRoot { 0: GRAPHQL_OPERATION_DEFINITION@0..17 0: GRAPHQL_OPERATION_TYPE@0..6 0: QUERY_KW@0..6 "query" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@6..16 - 0: GRAPHQL_NAME@6..16 "likeStory" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@6..16 + 0: IDENT@6..16 "likeStory" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@16..16 4: GRAPHQL_SELECTION_SET@16..17 @@ -1058,8 +1044,8 @@ GraphqlRoot { 1: GRAPHQL_OPERATION_DEFINITION@17..43 0: GRAPHQL_OPERATION_TYPE@17..25 0: QUERY_KW@17..25 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@25..34 - 0: GRAPHQL_NAME@25..34 "likeStory" [] [] + 1: GRAPHQL_NAME_BINDING@25..34 + 0: IDENT@25..34 "likeStory" [] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@34..34 4: GRAPHQL_SELECTION_SET@34..43 @@ -1067,8 +1053,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@34..42 0: GRAPHQL_FIELD@34..42 0: (empty) - 1: GRAPHQL_NAME@34..42 - 0: GRAPHQL_NAME@34..42 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@34..42 + 0: IDENT@34..42 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@42..42 4: (empty) @@ -1081,15 +1067,14 @@ GraphqlRoot { 0: L_PAREN@73..74 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@74..88 0: GRAPHQL_VARIABLE_DEFINITION@74..88 - 0: GRAPHQL_VARIABLE@74..82 + 0: GRAPHQL_VARIABLE_BINDING@74..82 0: DOLLAR@74..75 "$" [] [] - 1: GRAPHQL_NAME@75..82 - 0: GRAPHQL_NAME@75..82 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@75..82 + 0: IDENT@75..82 "storyId" [] [] 1: COLON@82..84 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@84..88 - 0: GRAPHQL_NAMED_TYPE@84..86 - 0: GRAPHQL_NAME@84..86 - 0: GRAPHQL_NAME@84..86 "ID" [] [] + 0: GRAPHQL_NAME_REFERENCE@84..86 + 0: IDENT@84..86 "ID" [] [] 1: BANG@86..88 "!" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@88..88 @@ -1100,19 +1085,19 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@89..119 0: GRAPHQL_FIELD@89..119 0: (empty) - 1: GRAPHQL_NAME@89..100 - 0: GRAPHQL_NAME@89..100 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@89..100 + 0: IDENT@89..100 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@100..119 0: L_PAREN@100..101 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@101..118 0: GRAPHQL_ARGUMENT@101..118 - 0: GRAPHQL_NAME@101..108 - 0: GRAPHQL_NAME@101..108 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@101..108 + 0: IDENT@101..108 "storyId" [] [] 1: COLON@108..110 ":" [] [Whitespace(" ")] - 2: GRAPHQL_VARIABLE@110..118 + 2: GRAPHQL_VARIABLE_REFERENCE@110..118 0: DOLLAR@110..111 "$" [] [] - 1: GRAPHQL_NAME@111..118 - 0: GRAPHQL_NAME@111..118 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@111..118 + 0: IDENT@111..118 "storyId" [] [] 2: R_PAREN@118..119 ")" [] [] 3: GRAPHQL_DIRECTIVE_LIST@119..119 4: (empty) @@ -1125,15 +1110,14 @@ GraphqlRoot { 0: (empty) 1: GRAPHQL_VARIABLE_DEFINITION_LIST@129..143 0: GRAPHQL_VARIABLE_DEFINITION@129..143 - 0: GRAPHQL_VARIABLE@129..137 + 0: GRAPHQL_VARIABLE_BINDING@129..137 0: DOLLAR@129..130 "$" [] [] - 1: GRAPHQL_NAME@130..137 - 0: GRAPHQL_NAME@130..137 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@130..137 + 0: IDENT@130..137 "storyId" [] [] 1: COLON@137..139 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@139..143 - 0: GRAPHQL_NAMED_TYPE@139..141 - 0: GRAPHQL_NAME@139..141 - 0: GRAPHQL_NAME@139..141 "ID" [] [] + 0: GRAPHQL_NAME_REFERENCE@139..141 + 0: IDENT@139..141 "ID" [] [] 1: BANG@141..143 "!" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@143..143 @@ -1144,19 +1128,19 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@144..174 0: GRAPHQL_FIELD@144..174 0: (empty) - 1: GRAPHQL_NAME@144..155 - 0: GRAPHQL_NAME@144..155 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@144..155 + 0: IDENT@144..155 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@155..174 0: L_PAREN@155..156 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@156..173 0: GRAPHQL_ARGUMENT@156..173 - 0: GRAPHQL_NAME@156..163 - 0: GRAPHQL_NAME@156..163 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@156..163 + 0: IDENT@156..163 "storyId" [] [] 1: COLON@163..165 ":" [] [Whitespace(" ")] - 2: GRAPHQL_VARIABLE@165..173 + 2: GRAPHQL_VARIABLE_REFERENCE@165..173 0: DOLLAR@165..166 "$" [] [] - 1: GRAPHQL_NAME@166..173 - 0: GRAPHQL_NAME@166..173 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@166..173 + 0: IDENT@166..173 "storyId" [] [] 2: R_PAREN@173..174 ")" [] [] 3: GRAPHQL_DIRECTIVE_LIST@174..174 4: (empty) @@ -1169,15 +1153,14 @@ GraphqlRoot { 0: (empty) 1: GRAPHQL_VARIABLE_DEFINITION_LIST@184..197 0: GRAPHQL_VARIABLE_DEFINITION@184..197 - 0: GRAPHQL_VARIABLE@184..192 + 0: GRAPHQL_VARIABLE_BINDING@184..192 0: DOLLAR@184..185 "$" [] [] - 1: GRAPHQL_NAME@185..192 - 0: GRAPHQL_NAME@185..192 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@185..192 + 0: IDENT@185..192 "storyId" [] [] 1: COLON@192..194 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@194..197 - 0: GRAPHQL_NAMED_TYPE@194..196 - 0: GRAPHQL_NAME@194..196 - 0: GRAPHQL_NAME@194..196 "ID" [] [] + 0: GRAPHQL_NAME_REFERENCE@194..196 + 0: IDENT@194..196 "ID" [] [] 1: BANG@196..197 "!" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@197..197 @@ -1188,19 +1171,19 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@200..230 0: GRAPHQL_FIELD@200..230 0: (empty) - 1: GRAPHQL_NAME@200..211 - 0: GRAPHQL_NAME@200..211 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@200..211 + 0: IDENT@200..211 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@211..230 0: L_PAREN@211..212 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@212..229 0: GRAPHQL_ARGUMENT@212..229 - 0: GRAPHQL_NAME@212..219 - 0: GRAPHQL_NAME@212..219 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@212..219 + 0: IDENT@212..219 "storyId" [] [] 1: COLON@219..221 ":" [] [Whitespace(" ")] - 2: GRAPHQL_VARIABLE@221..229 + 2: GRAPHQL_VARIABLE_REFERENCE@221..229 0: DOLLAR@221..222 "$" [] [] - 1: GRAPHQL_NAME@222..229 - 0: GRAPHQL_NAME@222..229 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@222..229 + 0: IDENT@222..229 "storyId" [] [] 2: R_PAREN@229..230 ")" [] [] 3: GRAPHQL_DIRECTIVE_LIST@230..230 4: (empty) @@ -1213,7 +1196,7 @@ GraphqlRoot { 0: L_PAREN@240..241 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@241..244 0: GRAPHQL_VARIABLE_DEFINITION@241..244 - 0: GRAPHQL_VARIABLE@241..242 + 0: GRAPHQL_VARIABLE_BINDING@241..242 0: DOLLAR@241..242 "$" [] [] 1: (empty) 1: COLON@242..244 ":" [] [Whitespace(" ")] @@ -1227,16 +1210,16 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@247..270 0: GRAPHQL_FIELD@247..270 0: (empty) - 1: GRAPHQL_NAME@247..258 - 0: GRAPHQL_NAME@247..258 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@247..258 + 0: IDENT@247..258 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@258..270 0: L_PAREN@258..259 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@259..269 0: GRAPHQL_ARGUMENT@259..269 - 0: GRAPHQL_NAME@259..266 - 0: GRAPHQL_NAME@259..266 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@259..266 + 0: IDENT@259..266 "storyId" [] [] 1: COLON@266..268 ":" [] [Whitespace(" ")] - 2: GRAPHQL_VARIABLE@268..269 + 2: GRAPHQL_VARIABLE_REFERENCE@268..269 0: DOLLAR@268..269 "$" [] [] 1: (empty) 2: R_PAREN@269..270 ")" [] [] @@ -1250,7 +1233,7 @@ GraphqlRoot { 0: L_PAREN@280..281 "(" [] [] 1: GRAPHQL_BOGUS@281..284 0: GRAPHQL_BOGUS@281..284 - 0: GRAPHQL_NAME@281..282 "a" [] [] + 0: IDENT@281..282 "a" [] [] 1: COLON@282..284 ":" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@284..284 2: R_PAREN@284..286 ")" [] [Whitespace(" ")] @@ -1260,8 +1243,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@287..298 0: GRAPHQL_FIELD@287..298 0: (empty) - 1: GRAPHQL_NAME@287..298 - 0: GRAPHQL_NAME@287..298 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@287..298 + 0: IDENT@287..298 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@298..298 4: (empty) @@ -1273,7 +1256,7 @@ GraphqlRoot { 0: L_PAREN@308..309 "(" [] [] 1: GRAPHQL_BOGUS@309..313 0: GRAPHQL_BOGUS@309..313 - 0: GRAPHQL_NAME@309..310 "a" [] [] + 0: IDENT@309..310 "a" [] [] 1: COLON@310..313 ":" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@313..313 2: GRAPHQL_DIRECTIVE_LIST@313..313 @@ -1282,8 +1265,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@314..325 0: GRAPHQL_FIELD@314..325 0: (empty) - 1: GRAPHQL_NAME@314..325 - 0: GRAPHQL_NAME@314..325 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@314..325 + 0: IDENT@314..325 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@325..325 4: (empty) @@ -1308,8 +1291,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@341..352 0: GRAPHQL_FIELD@341..352 0: (empty) - 1: GRAPHQL_NAME@341..352 - 0: GRAPHQL_NAME@341..352 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@341..352 + 0: IDENT@341..352 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@352..352 4: (empty) @@ -1334,8 +1317,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@367..378 0: GRAPHQL_FIELD@367..378 0: (empty) - 1: GRAPHQL_NAME@367..378 - 0: GRAPHQL_NAME@367..378 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@367..378 + 0: IDENT@367..378 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@378..378 4: (empty) @@ -1360,8 +1343,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@392..403 0: GRAPHQL_FIELD@392..403 0: (empty) - 1: GRAPHQL_NAME@392..403 - 0: GRAPHQL_NAME@392..403 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@392..403 + 0: IDENT@392..403 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@403..403 4: (empty) @@ -1380,8 +1363,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@417..428 0: GRAPHQL_FIELD@417..428 0: (empty) - 1: GRAPHQL_NAME@417..428 - 0: GRAPHQL_NAME@417..428 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@417..428 + 0: IDENT@417..428 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@428..428 4: (empty) @@ -1394,10 +1377,10 @@ GraphqlRoot { 0: L_PAREN@438..439 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@439..453 0: GRAPHQL_VARIABLE_DEFINITION@439..453 - 0: GRAPHQL_VARIABLE@439..447 + 0: GRAPHQL_VARIABLE_BINDING@439..447 0: DOLLAR@439..440 "$" [] [] - 1: GRAPHQL_NAME@440..447 - 0: GRAPHQL_NAME@440..447 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@440..447 + 0: IDENT@440..447 "storyId" [] [] 1: COLON@447..449 ":" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DEFAULT_VALUE@449..451 @@ -1415,8 +1398,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@454..465 0: GRAPHQL_FIELD@454..465 0: (empty) - 1: GRAPHQL_NAME@454..465 - 0: GRAPHQL_NAME@454..465 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@454..465 + 0: IDENT@454..465 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@465..465 4: (empty) @@ -1434,8 +1417,8 @@ GraphqlRoot { 0: GRAPHQL_ALIAS@495..499 0: (empty) 1: COLON@495..499 ":" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: GRAPHQL_NAME@499..508 - 0: GRAPHQL_NAME@499..508 "likeStory" [] [] + 1: GRAPHQL_LITERAL_NAME@499..508 + 0: IDENT@499..508 "likeStory" [] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@508..508 4: (empty) @@ -1451,15 +1434,15 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@541..571 0: GRAPHQL_FIELD@541..553 0: (empty) - 1: GRAPHQL_NAME@541..553 - 0: GRAPHQL_NAME@541..553 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@541..553 + 0: IDENT@541..553 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@553..553 4: (empty) 1: GRAPHQL_FIELD@553..562 0: GRAPHQL_ALIAS@553..562 - 0: GRAPHQL_NAME@553..560 - 0: GRAPHQL_NAME@553..560 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@553..560 + 0: IDENT@553..560 "storyId" [] [] 1: COLON@560..562 ":" [] [Whitespace(" ")] 1: (empty) 2: (empty) @@ -1469,8 +1452,8 @@ GraphqlRoot { 0: DOLLAR@562..563 "$" [] [] 3: GRAPHQL_FIELD@563..570 0: (empty) - 1: GRAPHQL_NAME@563..570 - 0: GRAPHQL_NAME@563..570 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@563..570 + 0: IDENT@563..570 "storyId" [] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@570..570 4: (empty) @@ -1485,15 +1468,14 @@ GraphqlRoot { 0: L_PAREN@581..582 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@582..595 0: GRAPHQL_VARIABLE_DEFINITION@582..595 - 0: GRAPHQL_VARIABLE@582..590 + 0: GRAPHQL_VARIABLE_BINDING@582..590 0: DOLLAR@582..583 "$" [] [] - 1: GRAPHQL_NAME@583..590 - 0: GRAPHQL_NAME@583..590 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@583..590 + 0: IDENT@583..590 "storyId" [] [] 1: COLON@590..592 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@592..595 - 0: GRAPHQL_NAMED_TYPE@592..594 - 0: GRAPHQL_NAME@592..594 - 0: GRAPHQL_NAME@592..594 "ID" [] [] + 0: GRAPHQL_NAME_REFERENCE@592..594 + 0: IDENT@592..594 "ID" [] [] 1: BANG@594..595 "!" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@595..595 @@ -1504,19 +1486,19 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@598..628 0: GRAPHQL_FIELD@598..628 0: (empty) - 1: GRAPHQL_NAME@598..609 - 0: GRAPHQL_NAME@598..609 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@598..609 + 0: IDENT@598..609 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@609..628 0: L_PAREN@609..610 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@610..627 0: GRAPHQL_ARGUMENT@610..627 - 0: GRAPHQL_NAME@610..617 - 0: GRAPHQL_NAME@610..617 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@610..617 + 0: IDENT@610..617 "storyId" [] [] 1: COLON@617..619 ":" [] [Whitespace(" ")] - 2: GRAPHQL_VARIABLE@619..627 + 2: GRAPHQL_VARIABLE_REFERENCE@619..627 0: DOLLAR@619..620 "$" [] [] - 1: GRAPHQL_NAME@620..627 - 0: GRAPHQL_NAME@620..627 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@620..627 + 0: IDENT@620..627 "storyId" [] [] 2: R_PAREN@627..628 ")" [] [] 3: GRAPHQL_DIRECTIVE_LIST@628..628 4: (empty) @@ -1529,15 +1511,14 @@ GraphqlRoot { 0: L_PAREN@638..639 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@639..652 0: GRAPHQL_VARIABLE_DEFINITION@639..652 - 0: GRAPHQL_VARIABLE@639..647 + 0: GRAPHQL_VARIABLE_BINDING@639..647 0: DOLLAR@639..640 "$" [] [] - 1: GRAPHQL_NAME@640..647 - 0: GRAPHQL_NAME@640..647 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@640..647 + 0: IDENT@640..647 "storyId" [] [] 1: COLON@647..649 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@649..652 - 0: GRAPHQL_NAMED_TYPE@649..651 - 0: GRAPHQL_NAME@649..651 - 0: GRAPHQL_NAME@649..651 "ID" [] [] + 0: GRAPHQL_NAME_REFERENCE@649..651 + 0: IDENT@649..651 "ID" [] [] 1: BANG@651..652 "!" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@652..652 @@ -1548,15 +1529,15 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@656..685 0: GRAPHQL_FIELD@656..668 0: (empty) - 1: GRAPHQL_NAME@656..668 - 0: GRAPHQL_NAME@656..668 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@656..668 + 0: IDENT@656..668 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@668..668 4: (empty) 1: GRAPHQL_FIELD@668..677 0: GRAPHQL_ALIAS@668..677 - 0: GRAPHQL_NAME@668..675 - 0: GRAPHQL_NAME@668..675 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@668..675 + 0: IDENT@668..675 "storyId" [] [] 1: COLON@675..677 ":" [] [Whitespace(" ")] 1: (empty) 2: (empty) @@ -1566,8 +1547,8 @@ GraphqlRoot { 0: DOLLAR@677..678 "$" [] [] 3: GRAPHQL_FIELD@678..685 0: (empty) - 1: GRAPHQL_NAME@678..685 - 0: GRAPHQL_NAME@678..685 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@678..685 + 0: IDENT@678..685 "storyId" [] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@685..685 4: (empty) @@ -1580,15 +1561,14 @@ GraphqlRoot { 0: L_PAREN@695..696 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@696..709 0: GRAPHQL_VARIABLE_DEFINITION@696..709 - 0: GRAPHQL_VARIABLE@696..704 + 0: GRAPHQL_VARIABLE_BINDING@696..704 0: DOLLAR@696..697 "$" [] [] - 1: GRAPHQL_NAME@697..704 - 0: GRAPHQL_NAME@697..704 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@697..704 + 0: IDENT@697..704 "storyId" [] [] 1: COLON@704..706 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@706..709 - 0: GRAPHQL_NAMED_TYPE@706..708 - 0: GRAPHQL_NAME@706..708 - 0: GRAPHQL_NAME@706..708 "ID" [] [] + 0: GRAPHQL_NAME_REFERENCE@706..708 + 0: IDENT@706..708 "ID" [] [] 1: BANG@708..709 "!" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@709..709 @@ -1599,15 +1579,15 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@712..734 0: GRAPHQL_FIELD@712..724 0: (empty) - 1: GRAPHQL_NAME@712..724 - 0: GRAPHQL_NAME@712..724 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@712..724 + 0: IDENT@712..724 "likeStory" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@724..724 4: (empty) 1: GRAPHQL_FIELD@724..733 0: GRAPHQL_ALIAS@724..733 - 0: GRAPHQL_NAME@724..731 - 0: GRAPHQL_NAME@724..731 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@724..731 + 0: IDENT@724..731 "storyId" [] [] 1: COLON@731..733 ":" [] [Whitespace(" ")] 1: (empty) 2: (empty) @@ -1623,7 +1603,7 @@ GraphqlRoot { 0: L_PAREN@744..745 "(" [] [] 1: GRAPHQL_BOGUS@745..754 0: GRAPHQL_VARIABLE_DEFINITION@745..746 - 0: GRAPHQL_VARIABLE@745..746 + 0: GRAPHQL_VARIABLE_BINDING@745..746 0: DOLLAR@745..746 "$" [] [] 1: (empty) 1: (empty) @@ -1648,8 +1628,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@757..768 0: GRAPHQL_FIELD@757..768 0: (empty) - 1: GRAPHQL_NAME@757..768 - 0: GRAPHQL_NAME@757..768 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@757..768 + 0: IDENT@757..768 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@768..768 4: (empty) @@ -1662,15 +1642,14 @@ GraphqlRoot { 0: L_PAREN@801..802 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@802..815 0: GRAPHQL_VARIABLE_DEFINITION@802..815 - 0: GRAPHQL_VARIABLE@802..810 + 0: GRAPHQL_VARIABLE_BINDING@802..810 0: DOLLAR@802..803 "$" [] [] - 1: GRAPHQL_NAME@803..810 - 0: GRAPHQL_NAME@803..810 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@803..810 + 0: IDENT@803..810 "storyId" [] [] 1: COLON@810..812 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@812..815 - 0: GRAPHQL_NAMED_TYPE@812..814 - 0: GRAPHQL_NAME@812..814 - 0: GRAPHQL_NAME@812..814 "ID" [] [] + 0: GRAPHQL_NAME_REFERENCE@812..814 + 0: IDENT@812..814 "ID" [] [] 1: BANG@814..815 "!" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@815..815 @@ -1685,8 +1664,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@820..831 0: GRAPHQL_FIELD@820..831 0: (empty) - 1: GRAPHQL_NAME@820..831 - 0: GRAPHQL_NAME@820..831 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@820..831 + 0: IDENT@820..831 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@831..831 4: (empty) diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/selection_set.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/selection_set.graphql.snap index aee11ad08e98..552e0b7e144b 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/selection_set.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/selection_set.graphql.snap @@ -103,8 +103,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@1..8 "hero" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@1..8 "hero" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -113,8 +113,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@9..17 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@9..17 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -122,8 +122,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@17..23 "age" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@17..23 "age" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -135,8 +135,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@26..34 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@26..34 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -150,8 +150,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlBogusSelection { items: [ - GraphqlName { - value_token: GRAPHQL_NAME@38..44 "hero" [Newline("\n"), Whitespace("\t")] [], + GraphqlLiteralName { + value_token: IDENT@38..44 "hero" [Newline("\n"), Whitespace("\t")] [], }, GraphqlBogus { items: [ @@ -159,8 +159,8 @@ GraphqlRoot { GraphqlBogus { items: [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@45..49 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@45..49 "name" [] [], }, colon_token: COLON@49..51 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -174,8 +174,8 @@ GraphqlRoot { ], }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@68..74 "hero" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@68..74 "hero" [Newline("\n"), Whitespace("\t")] [], }, colon_token: missing (required), value: missing (required), @@ -194,8 +194,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@75..80 "name" [] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@75..80 "name" [] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -209,8 +209,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@93..104 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@93..104 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -218,8 +218,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@104..112 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@104..112 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -227,8 +227,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@112..118 "age" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@112..118 "age" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -247,15 +247,15 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@126..132 "hero" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@126..132 "hero" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@132..133 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@133..137 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@133..137 "name" [] [], }, colon_token: COLON@137..139 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -271,8 +271,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@154..165 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@154..165 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -280,8 +280,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@165..173 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@165..173 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -289,8 +289,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@173..180 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@173..180 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -298,8 +298,8 @@ GraphqlRoot { }, GraphqlBogusSelection { items: [ - GraphqlName { - value_token: GRAPHQL_NAME@180..189 "height" [Newline("\n"), Whitespace("\t\t")] [], + GraphqlLiteralName { + value_token: IDENT@180..189 "height" [Newline("\n"), Whitespace("\t\t")] [], }, GraphqlBogus { items: [ @@ -307,13 +307,13 @@ GraphqlRoot { GraphqlBogus { items: [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@190..195 "unit" [] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@190..195 "unit" [] [Whitespace(" ")], }, colon_token: missing (required), value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@195..200 "FOOT" [] [Skipped(",")], + value: GraphqlLiteralName { + value_token: IDENT@195..200 "FOOT" [] [Skipped(",")], }, }, }, @@ -325,8 +325,8 @@ GraphqlRoot { ], }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@208..218 "ironMan" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@208..218 "ironMan" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@218..220 ":" [] [Whitespace(" ")], value: missing (required), @@ -345,8 +345,8 @@ GraphqlRoot { }, GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@221..225 "name" [] [], + value: GraphqlLiteralName { + value_token: IDENT@221..225 "name" [] [], }, colon_token: COLON@225..227 ":" [] [Whitespace(" ")], }, @@ -382,8 +382,8 @@ GraphqlRoot { l_paren_token: L_PAREN@251..252 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@252..256 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@252..256 "name" [] [], }, colon_token: COLON@256..258 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -404,20 +404,20 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@276..286 "ironMan" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@276..286 "ironMan" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@286..288 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@288..292 "hero" [] [], + name: GraphqlLiteralName { + value_token: IDENT@288..292 "hero" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@292..293 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@293..297 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@293..297 "name" [] [], }, colon_token: COLON@297..299 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -433,8 +433,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@314..325 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@314..325 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -442,20 +442,20 @@ GraphqlRoot { }, GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@325..337 "firstWife" [Newline("\n"), Whitespace("\t\t")] [], + value: GraphqlLiteralName { + value_token: IDENT@325..337 "firstWife" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@337..339 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@339..343 "wife" [] [], + name: GraphqlLiteralName { + value_token: IDENT@339..343 "wife" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@343..344 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@344..348 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@344..348 "name" [] [], }, colon_token: COLON@348..350 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -484,20 +484,20 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@372..382 "ironMan" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@372..382 "ironMan" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@382..384 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@384..388 "hero" [] [], + name: GraphqlLiteralName { + value_token: IDENT@384..388 "hero" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@388..389 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@389..393 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@389..393 "name" [] [], }, colon_token: COLON@393..395 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -519,15 +519,15 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@411..422 "country" [Newline("\n"), Whitespace("\t\t")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@411..422 "country" [Newline("\n"), Whitespace("\t\t")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@422..424 "@" [] [Skipped(",")], - name: GraphqlName { - value_token: GRAPHQL_NAME@424..432 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlNameReference { + value_token: IDENT@424..432 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), }, @@ -536,8 +536,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@432..438 "age" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@432..438 "age" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -556,8 +556,8 @@ GraphqlRoot { GraphqlBogusSelection { items: [ GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@464..474 "ironMan" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@464..474 "ironMan" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@474..476 ":" [] [Whitespace(" ")], }, @@ -617,8 +617,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@520..527 "hero" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@520..527 "hero" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -640,8 +640,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@542..543 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@543..550 "hero" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlNameReference { + value_token: IDENT@543..550 "hero" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: missing (optional), }, @@ -660,8 +660,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlFragmentSpread { dotdotdot_token: DOT3@558..565 "..." [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@565..570 "Hero" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@565..570 "Hero" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { @@ -678,8 +678,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@573..581 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@573..581 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -687,8 +687,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@581..587 "age" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@581..587 "age" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -734,8 +734,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@1..34 0: GRAPHQL_FIELD@1..26 0: (empty) - 1: GRAPHQL_NAME@1..8 - 0: GRAPHQL_NAME@1..8 "hero" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@1..8 + 0: IDENT@1..8 "hero" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@8..8 4: GRAPHQL_SELECTION_SET@8..26 @@ -743,23 +743,23 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@9..23 0: GRAPHQL_FIELD@9..17 0: (empty) - 1: GRAPHQL_NAME@9..17 - 0: GRAPHQL_NAME@9..17 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@9..17 + 0: IDENT@9..17 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@17..17 4: (empty) 1: GRAPHQL_FIELD@17..23 0: (empty) - 1: GRAPHQL_NAME@17..23 - 0: GRAPHQL_NAME@17..23 "age" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@17..23 + 0: IDENT@17..23 "age" [Newline("\n"), Whitespace("\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@23..23 4: (empty) 2: R_CURLY@23..26 "}" [Newline("\n"), Newline("\n")] [] 1: GRAPHQL_FIELD@26..34 0: (empty) - 1: GRAPHQL_NAME@26..34 - 0: GRAPHQL_NAME@26..34 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@26..34 + 0: IDENT@26..34 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@34..34 4: (empty) @@ -768,14 +768,14 @@ GraphqlRoot { 0: L_CURLY@35..38 "{" [Newline("\n"), Newline("\n")] [] 1: GRAPHQL_SELECTION_LIST@38..118 0: GRAPHQL_BOGUS_SELECTION@38..74 - 0: GRAPHQL_NAME@38..44 - 0: GRAPHQL_NAME@38..44 "hero" [Newline("\n"), Whitespace("\t")] [] + 0: GRAPHQL_LITERAL_NAME@38..44 + 0: IDENT@38..44 "hero" [Newline("\n"), Whitespace("\t")] [] 1: GRAPHQL_BOGUS@44..74 0: L_PAREN@44..45 "(" [] [] 1: GRAPHQL_BOGUS@45..74 0: GRAPHQL_ARGUMENT@45..63 - 0: GRAPHQL_NAME@45..49 - 0: GRAPHQL_NAME@45..49 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@45..49 + 0: IDENT@45..49 "name" [] [] 1: COLON@49..51 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@51..63 0: GRAPHQL_STRING_LITERAL@51..63 "\"Tony Stark\"" [] [] @@ -783,8 +783,8 @@ GraphqlRoot { 0: R_CURLY@63..65 "}" [Newline("\n")] [] 1: L_CURLY@65..68 "{" [Newline("\n"), Newline("\n")] [] 2: GRAPHQL_ARGUMENT@68..74 - 0: GRAPHQL_NAME@68..74 - 0: GRAPHQL_NAME@68..74 "hero" [Newline("\n"), Whitespace("\t")] [] + 0: GRAPHQL_LITERAL_NAME@68..74 + 0: IDENT@68..74 "hero" [Newline("\n"), Whitespace("\t")] [] 1: (empty) 2: (empty) 2: GRAPHQL_DIRECTIVE_LIST@74..74 @@ -792,8 +792,8 @@ GraphqlRoot { 0: L_PAREN@74..75 "(" [] [] 2: GRAPHQL_FIELD@75..80 0: (empty) - 1: GRAPHQL_NAME@75..80 - 0: GRAPHQL_NAME@75..80 "name" [] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@75..80 + 0: IDENT@75..80 "name" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@80..80 4: (empty) @@ -802,22 +802,22 @@ GraphqlRoot { 1: R_PAREN@92..93 ")" [] [] 4: GRAPHQL_FIELD@93..104 0: (empty) - 1: GRAPHQL_NAME@93..104 - 0: GRAPHQL_NAME@93..104 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@93..104 + 0: IDENT@93..104 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@104..104 4: (empty) 5: GRAPHQL_FIELD@104..112 0: (empty) - 1: GRAPHQL_NAME@104..112 - 0: GRAPHQL_NAME@104..112 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@104..112 + 0: IDENT@104..112 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@112..112 4: (empty) 6: GRAPHQL_FIELD@112..118 0: (empty) - 1: GRAPHQL_NAME@112..118 - 0: GRAPHQL_NAME@112..118 "age" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@112..118 + 0: IDENT@112..118 "age" [Newline("\n"), Whitespace("\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@118..118 4: (empty) @@ -829,14 +829,14 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@126..271 0: GRAPHQL_FIELD@126..242 0: (empty) - 1: GRAPHQL_NAME@126..132 - 0: GRAPHQL_NAME@126..132 "hero" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@126..132 + 0: IDENT@126..132 "hero" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@132..153 0: L_PAREN@132..133 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@133..151 0: GRAPHQL_ARGUMENT@133..151 - 0: GRAPHQL_NAME@133..137 - 0: GRAPHQL_NAME@133..137 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@133..137 + 0: IDENT@133..137 "name" [] [] 1: COLON@137..139 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@139..151 0: GRAPHQL_STRING_LITERAL@139..151 "\"Tony Stark\"" [] [] @@ -847,45 +847,45 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@154..240 0: GRAPHQL_FIELD@154..165 0: (empty) - 1: GRAPHQL_NAME@154..165 - 0: GRAPHQL_NAME@154..165 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@154..165 + 0: IDENT@154..165 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@165..165 4: (empty) 1: GRAPHQL_FIELD@165..173 0: (empty) - 1: GRAPHQL_NAME@165..173 - 0: GRAPHQL_NAME@165..173 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@165..173 + 0: IDENT@165..173 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@173..173 4: (empty) 2: GRAPHQL_FIELD@173..180 0: (empty) - 1: GRAPHQL_NAME@173..180 - 0: GRAPHQL_NAME@173..180 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@173..180 + 0: IDENT@173..180 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@180..180 4: (empty) 3: GRAPHQL_BOGUS_SELECTION@180..220 - 0: GRAPHQL_NAME@180..189 - 0: GRAPHQL_NAME@180..189 "height" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@180..189 + 0: IDENT@180..189 "height" [Newline("\n"), Whitespace("\t\t")] [] 1: GRAPHQL_BOGUS@189..220 0: L_PAREN@189..190 "(" [] [] 1: GRAPHQL_BOGUS@190..220 0: GRAPHQL_ARGUMENT@190..200 - 0: GRAPHQL_NAME@190..195 - 0: GRAPHQL_NAME@190..195 "unit" [] [Whitespace(" ")] + 0: GRAPHQL_LITERAL_NAME@190..195 + 0: IDENT@190..195 "unit" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_ENUM_VALUE@195..200 - 0: GRAPHQL_NAME@195..200 - 0: GRAPHQL_NAME@195..200 "FOOT" [] [Skipped(",")] + 0: GRAPHQL_LITERAL_NAME@195..200 + 0: IDENT@195..200 "FOOT" [] [Skipped(",")] 1: GRAPHQL_BOGUS@200..208 0: R_CURLY@200..203 "}" [Newline("\n"), Whitespace("\t")] [] 1: R_CURLY@203..205 "}" [Newline("\n")] [] 2: L_CURLY@205..208 "{" [Newline("\n"), Newline("\n")] [] 2: GRAPHQL_ARGUMENT@208..220 - 0: GRAPHQL_NAME@208..218 - 0: GRAPHQL_NAME@208..218 "ironMan" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@208..218 + 0: IDENT@208..218 "ironMan" [Newline("\n"), Whitespace(" ")] [] 1: COLON@218..220 ":" [] [Whitespace(" ")] 2: (empty) 2: GRAPHQL_DIRECTIVE_LIST@220..220 @@ -893,8 +893,8 @@ GraphqlRoot { 0: L_PAREN@220..221 "(" [] [] 5: GRAPHQL_FIELD@221..227 0: GRAPHQL_ALIAS@221..227 - 0: GRAPHQL_NAME@221..225 - 0: GRAPHQL_NAME@221..225 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@221..225 + 0: IDENT@221..225 "name" [] [] 1: COLON@225..227 ":" [] [Whitespace(" ")] 1: (empty) 2: (empty) @@ -914,8 +914,8 @@ GraphqlRoot { 0: L_PAREN@251..252 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@252..270 0: GRAPHQL_ARGUMENT@252..270 - 0: GRAPHQL_NAME@252..256 - 0: GRAPHQL_NAME@252..256 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@252..256 + 0: IDENT@252..256 "name" [] [] 1: COLON@256..258 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@258..270 0: GRAPHQL_STRING_LITERAL@258..270 "\"Tony Stark\"" [] [] @@ -927,17 +927,17 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@276..367 0: GRAPHQL_FIELD@276..367 0: GRAPHQL_ALIAS@276..288 - 0: GRAPHQL_NAME@276..286 - 0: GRAPHQL_NAME@276..286 "ironMan" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@276..286 + 0: IDENT@276..286 "ironMan" [Newline("\n"), Whitespace(" ")] [] 1: COLON@286..288 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@288..292 - 0: GRAPHQL_NAME@288..292 "hero" [] [] + 1: GRAPHQL_LITERAL_NAME@288..292 + 0: IDENT@288..292 "hero" [] [] 2: GRAPHQL_ARGUMENTS@292..313 0: L_PAREN@292..293 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@293..311 0: GRAPHQL_ARGUMENT@293..311 - 0: GRAPHQL_NAME@293..297 - 0: GRAPHQL_NAME@293..297 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@293..297 + 0: IDENT@293..297 "name" [] [] 1: COLON@297..299 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@299..311 0: GRAPHQL_STRING_LITERAL@299..311 "\"Tony Stark\"" [] [] @@ -948,24 +948,24 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@314..364 0: GRAPHQL_FIELD@314..325 0: (empty) - 1: GRAPHQL_NAME@314..325 - 0: GRAPHQL_NAME@314..325 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@314..325 + 0: IDENT@314..325 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@325..325 4: (empty) 1: GRAPHQL_FIELD@325..364 0: GRAPHQL_ALIAS@325..339 - 0: GRAPHQL_NAME@325..337 - 0: GRAPHQL_NAME@325..337 "firstWife" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@325..337 + 0: IDENT@325..337 "firstWife" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@337..339 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@339..343 - 0: GRAPHQL_NAME@339..343 "wife" [] [] + 1: GRAPHQL_LITERAL_NAME@339..343 + 0: IDENT@339..343 "wife" [] [] 2: GRAPHQL_ARGUMENTS@343..359 0: L_PAREN@343..344 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@344..358 0: GRAPHQL_ARGUMENT@344..358 - 0: GRAPHQL_NAME@344..348 - 0: GRAPHQL_NAME@344..348 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@344..348 + 0: IDENT@344..348 "name" [] [] 1: COLON@348..350 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@350..358 0: GRAPHQL_STRING_LITERAL@350..358 "\"Pepper\"" [] [] @@ -982,17 +982,17 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@372..441 0: GRAPHQL_FIELD@372..441 0: GRAPHQL_ALIAS@372..384 - 0: GRAPHQL_NAME@372..382 - 0: GRAPHQL_NAME@372..382 "ironMan" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@372..382 + 0: IDENT@372..382 "ironMan" [Newline("\n"), Whitespace(" ")] [] 1: COLON@382..384 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@384..388 - 0: GRAPHQL_NAME@384..388 "hero" [] [] + 1: GRAPHQL_LITERAL_NAME@384..388 + 0: IDENT@384..388 "hero" [] [] 2: GRAPHQL_ARGUMENTS@388..409 0: L_PAREN@388..389 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@389..407 0: GRAPHQL_ARGUMENT@389..407 - 0: GRAPHQL_NAME@389..393 - 0: GRAPHQL_NAME@389..393 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@389..393 + 0: IDENT@389..393 "name" [] [] 1: COLON@393..395 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@395..407 0: GRAPHQL_STRING_LITERAL@395..407 "\"Tony Stark\"" [] [] @@ -1007,20 +1007,20 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@411..438 0: GRAPHQL_FIELD@411..432 0: (empty) - 1: GRAPHQL_NAME@411..422 - 0: GRAPHQL_NAME@411..422 "country" [Newline("\n"), Whitespace("\t\t")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@411..422 + 0: IDENT@411..422 "country" [Newline("\n"), Whitespace("\t\t")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@422..432 0: GRAPHQL_DIRECTIVE@422..432 0: AT@422..424 "@" [] [Skipped(",")] - 1: GRAPHQL_NAME@424..432 - 0: GRAPHQL_NAME@424..432 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_NAME_REFERENCE@424..432 + 0: IDENT@424..432 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 4: (empty) 1: GRAPHQL_FIELD@432..438 0: (empty) - 1: GRAPHQL_NAME@432..438 - 0: GRAPHQL_NAME@432..438 "age" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@432..438 + 0: IDENT@432..438 "age" [Newline("\n"), Whitespace("\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@438..438 4: (empty) @@ -1031,8 +1031,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@464..507 0: GRAPHQL_BOGUS_SELECTION@464..507 0: GRAPHQL_ALIAS@464..476 - 0: GRAPHQL_NAME@464..474 - 0: GRAPHQL_NAME@464..474 "ironMan" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@464..474 + 0: IDENT@464..474 "ironMan" [Newline("\n"), Whitespace(" ")] [] 1: COLON@474..476 ":" [] [Whitespace(" ")] 1: GRAPHQL_BOGUS@476..493 0: L_PAREN@476..477 "(" [] [] @@ -1071,8 +1071,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@520..527 0: GRAPHQL_FIELD@520..527 0: (empty) - 1: GRAPHQL_NAME@520..527 - 0: GRAPHQL_NAME@520..527 "hero" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@520..527 + 0: IDENT@520..527 "hero" [Newline("\n"), Whitespace("\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@527..527 4: (empty) @@ -1087,8 +1087,8 @@ GraphqlRoot { 2: GRAPHQL_DIRECTIVE_LIST@542..550 0: GRAPHQL_DIRECTIVE@542..550 0: AT@542..543 "@" [] [] - 1: GRAPHQL_NAME@543..550 - 0: GRAPHQL_NAME@543..550 "hero" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_NAME_REFERENCE@543..550 + 0: IDENT@543..550 "hero" [Newline("\n"), Whitespace("\t\t")] [] 2: (empty) 3: GRAPHQL_SELECTION_SET@550..553 0: (empty) @@ -1100,8 +1100,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@558..587 0: GRAPHQL_FRAGMENT_SPREAD@558..572 0: DOT3@558..565 "..." [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 1: GRAPHQL_NAME@565..570 - 0: GRAPHQL_NAME@565..570 "Hero" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@565..570 + 0: IDENT@565..570 "Hero" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@570..572 0: GRAPHQL_DIRECTIVE@570..572 0: AT@570..572 "@" [] [Whitespace(" ")] @@ -1111,15 +1111,15 @@ GraphqlRoot { 0: L_CURLY@572..573 "{" [] [] 2: GRAPHQL_FIELD@573..581 0: (empty) - 1: GRAPHQL_NAME@573..581 - 0: GRAPHQL_NAME@573..581 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@573..581 + 0: IDENT@573..581 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@581..581 4: (empty) 3: GRAPHQL_FIELD@581..587 0: (empty) - 1: GRAPHQL_NAME@581..587 - 0: GRAPHQL_NAME@581..587 "age" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@581..587 + 0: IDENT@581..587 "age" [Newline("\n"), Whitespace("\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@587..587 4: (empty) diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/type.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/type.graphql.snap index 850aab33ba05..9afa1f6ad472 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/type.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/type.graphql.snap @@ -32,10 +32,10 @@ GraphqlRoot { GraphqlBogus { items: [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@7..8 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@8..15 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@8..15 "storyId" [] [], }, }, colon_token: COLON@15..17 ":" [] [Whitespace(" ")], @@ -47,10 +47,10 @@ GraphqlRoot { directives: GraphqlDirectiveList [], }, GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@20..21 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@21..29 "comments" [] [], + name: GraphqlLiteralName { + value_token: IDENT@21..29 "comments" [] [], }, }, colon_token: COLON@29..31 ":" [] [Whitespace(" ")], @@ -66,10 +66,10 @@ GraphqlRoot { directives: GraphqlDirectiveList [], }, GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@36..37 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@37..41 "tags" [] [], + name: GraphqlLiteralName { + value_token: IDENT@37..41 "tags" [] [], }, }, colon_token: COLON@41..43 ":" [] [Whitespace(" ")], @@ -88,17 +88,15 @@ GraphqlRoot { directives: GraphqlDirectiveList [], }, GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@49..50 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@50..55 "posts" [] [], + name: GraphqlLiteralName { + value_token: IDENT@50..55 "posts" [] [], }, }, colon_token: COLON@55..57 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@57..66 "PostInput" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@57..66 "PostInput" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -110,20 +108,18 @@ GraphqlRoot { ], }, GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@70..71 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@71..76 "input" [] [], + name: GraphqlLiteralName { + value_token: IDENT@71..76 "input" [] [], }, }, colon_token: COLON@76..78 ":" [] [Whitespace(" ")], ty: GraphqlListType { l_brack_token: L_BRACK@78..79 "[" [] [], element: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@79..88 "InputType" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@79..88 "InputType" [] [], }, excl_token: BANG@88..89 "!" [] [], }, @@ -143,8 +139,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@92..103 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@92..103 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -166,10 +162,10 @@ GraphqlRoot { GraphqlBogus { items: [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@114..115 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@115..122 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@115..122 "storyId" [] [], }, }, colon_token: COLON@122..124 ":" [] [Whitespace(" ")], @@ -186,10 +182,10 @@ GraphqlRoot { ], }, GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@128..129 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@129..137 "comments" [] [], + name: GraphqlLiteralName { + value_token: IDENT@129..137 "comments" [] [], }, }, colon_token: COLON@137..139 ":" [] [Whitespace(" ")], @@ -206,10 +202,10 @@ GraphqlRoot { ], }, GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@143..144 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@144..148 "tags" [] [], + name: GraphqlLiteralName { + value_token: IDENT@144..148 "tags" [] [], }, }, colon_token: COLON@148..150 ":" [] [Whitespace(" ")], @@ -240,8 +236,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@156..167 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@156..167 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -270,10 +266,10 @@ GraphqlRoot { 0: L_PAREN@6..7 "(" [] [] 1: GRAPHQL_BOGUS@7..89 0: GRAPHQL_VARIABLE_DEFINITION@7..20 - 0: GRAPHQL_VARIABLE@7..15 + 0: GRAPHQL_VARIABLE_BINDING@7..15 0: DOLLAR@7..8 "$" [] [] - 1: GRAPHQL_NAME@8..15 - 0: GRAPHQL_NAME@8..15 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@8..15 + 0: IDENT@8..15 "storyId" [] [] 1: COLON@15..17 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@17..20 0: (empty) @@ -281,10 +277,10 @@ GraphqlRoot { 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@20..20 1: GRAPHQL_VARIABLE_DEFINITION@20..36 - 0: GRAPHQL_VARIABLE@20..29 + 0: GRAPHQL_VARIABLE_BINDING@20..29 0: DOLLAR@20..21 "$" [] [] - 1: GRAPHQL_NAME@21..29 - 0: GRAPHQL_NAME@21..29 "comments" [] [] + 1: GRAPHQL_LITERAL_NAME@21..29 + 0: IDENT@21..29 "comments" [] [] 1: COLON@29..31 ":" [] [Whitespace(" ")] 2: GRAPHQL_LIST_TYPE@31..36 0: L_BRACK@31..32 "[" [] [] @@ -295,10 +291,10 @@ GraphqlRoot { 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@36..36 2: GRAPHQL_VARIABLE_DEFINITION@36..49 - 0: GRAPHQL_VARIABLE@36..41 + 0: GRAPHQL_VARIABLE_BINDING@36..41 0: DOLLAR@36..37 "$" [] [] - 1: GRAPHQL_NAME@37..41 - 0: GRAPHQL_NAME@37..41 "tags" [] [] + 1: GRAPHQL_LITERAL_NAME@37..41 + 0: IDENT@37..41 "tags" [] [] 1: COLON@41..43 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@43..49 0: GRAPHQL_LIST_TYPE@43..46 @@ -311,31 +307,29 @@ GraphqlRoot { 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@49..49 3: GRAPHQL_VARIABLE_DEFINITION@49..66 - 0: GRAPHQL_VARIABLE@49..55 + 0: GRAPHQL_VARIABLE_BINDING@49..55 0: DOLLAR@49..50 "$" [] [] - 1: GRAPHQL_NAME@50..55 - 0: GRAPHQL_NAME@50..55 "posts" [] [] + 1: GRAPHQL_LITERAL_NAME@50..55 + 0: IDENT@50..55 "posts" [] [] 1: COLON@55..57 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@57..66 - 0: GRAPHQL_NAME@57..66 - 0: GRAPHQL_NAME@57..66 "PostInput" [] [] + 2: GRAPHQL_NAME_REFERENCE@57..66 + 0: IDENT@57..66 "PostInput" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@66..66 4: GRAPHQL_BOGUS@66..70 0: R_BRACK@66..67 "]" [] [] 1: BANG@67..70 "!" [] [Skipped(","), Whitespace(" ")] 5: GRAPHQL_VARIABLE_DEFINITION@70..89 - 0: GRAPHQL_VARIABLE@70..76 + 0: GRAPHQL_VARIABLE_BINDING@70..76 0: DOLLAR@70..71 "$" [] [] - 1: GRAPHQL_NAME@71..76 - 0: GRAPHQL_NAME@71..76 "input" [] [] + 1: GRAPHQL_LITERAL_NAME@71..76 + 0: IDENT@71..76 "input" [] [] 1: COLON@76..78 ":" [] [Whitespace(" ")] 2: GRAPHQL_LIST_TYPE@78..89 0: L_BRACK@78..79 "[" [] [] 1: GRAPHQL_NON_NULL_TYPE@79..89 - 0: GRAPHQL_NAMED_TYPE@79..88 - 0: GRAPHQL_NAME@79..88 - 0: GRAPHQL_NAME@79..88 "InputType" [] [] + 0: GRAPHQL_NAME_REFERENCE@79..88 + 0: IDENT@79..88 "InputType" [] [] 1: BANG@88..89 "!" [] [] 2: (empty) 3: (empty) @@ -347,8 +341,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@92..103 0: GRAPHQL_FIELD@92..103 0: (empty) - 1: GRAPHQL_NAME@92..103 - 0: GRAPHQL_NAME@92..103 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@92..103 + 0: IDENT@92..103 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@103..103 4: (empty) @@ -360,10 +354,10 @@ GraphqlRoot { 0: L_PAREN@113..114 "(" [] [] 1: GRAPHQL_BOGUS@114..153 0: GRAPHQL_VARIABLE_DEFINITION@114..125 - 0: GRAPHQL_VARIABLE@114..122 + 0: GRAPHQL_VARIABLE_BINDING@114..122 0: DOLLAR@114..115 "$" [] [] - 1: GRAPHQL_NAME@115..122 - 0: GRAPHQL_NAME@115..122 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@115..122 + 0: IDENT@115..122 "storyId" [] [] 1: COLON@122..124 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@124..125 0: (empty) @@ -373,10 +367,10 @@ GraphqlRoot { 1: GRAPHQL_BOGUS@125..128 0: L_BRACK@125..128 "[" [] [Skipped(","), Whitespace(" ")] 2: GRAPHQL_VARIABLE_DEFINITION@128..140 - 0: GRAPHQL_VARIABLE@128..137 + 0: GRAPHQL_VARIABLE_BINDING@128..137 0: DOLLAR@128..129 "$" [] [] - 1: GRAPHQL_NAME@129..137 - 0: GRAPHQL_NAME@129..137 "comments" [] [] + 1: GRAPHQL_LITERAL_NAME@129..137 + 0: IDENT@129..137 "comments" [] [] 1: COLON@137..139 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@139..140 0: (empty) @@ -386,10 +380,10 @@ GraphqlRoot { 3: GRAPHQL_BOGUS@140..143 0: R_BRACK@140..143 "]" [] [Skipped(","), Whitespace(" ")] 4: GRAPHQL_VARIABLE_DEFINITION@143..153 - 0: GRAPHQL_VARIABLE@143..148 + 0: GRAPHQL_VARIABLE_BINDING@143..148 0: DOLLAR@143..144 "$" [] [] - 1: GRAPHQL_NAME@144..148 - 0: GRAPHQL_NAME@144..148 "tags" [] [] + 1: GRAPHQL_LITERAL_NAME@144..148 + 0: IDENT@144..148 "tags" [] [] 1: COLON@148..150 ":" [] [Whitespace(" ")] 2: GRAPHQL_LIST_TYPE@150..153 0: L_BRACK@150..151 "[" [] [] @@ -410,8 +404,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@156..167 0: GRAPHQL_FIELD@156..167 0: (empty) - 1: GRAPHQL_NAME@156..167 - 0: GRAPHQL_NAME@156..167 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@156..167 + 0: IDENT@156..167 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@167..167 4: (empty) diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/err/value.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/err/value.graphql.snap index acc83f27459e..f3628ad8b248 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/err/value.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/err/value.graphql.snap @@ -35,8 +35,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlBogusSelection { items: [ - GraphqlName { - value_token: GRAPHQL_NAME@1..14 "field_value" [Newline("\n"), Whitespace("\t")] [], + GraphqlLiteralName { + value_token: IDENT@1..14 "field_value" [Newline("\n"), Whitespace("\t")] [], }, GraphqlBogus { items: [ @@ -44,8 +44,8 @@ GraphqlRoot { GraphqlBogus { items: [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@15..29 "float_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@15..29 "float_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@29..31 ":" [] [Whitespace(" ")], value: missing (required), @@ -56,8 +56,8 @@ GraphqlRoot { ], }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@37..52 "string_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@37..52 "string_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@52..54 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -70,8 +70,8 @@ GraphqlRoot { ], }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@65..80 "string_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@65..80 "string_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@80..82 ":" [] [Whitespace(" ")], value: missing (required), @@ -82,30 +82,30 @@ GraphqlRoot { ], }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@90..106 "boolean_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@90..106 "boolean_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@106..108 ":" [] [Whitespace(" ")], value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@108..114 "truee" [] [Skipped(",")], + value: GraphqlLiteralName { + value_token: IDENT@108..114 "truee" [] [Skipped(",")], }, }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@114..127 "null_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@114..127 "null_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@127..129 ":" [] [Whitespace(" ")], value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@129..135 "nulll" [] [Skipped(",")], + value: GraphqlLiteralName { + value_token: IDENT@129..135 "nulll" [] [Skipped(",")], }, }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@135..148 "list_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@135..148 "list_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@148..150 ":" [] [Whitespace(" ")], value: GraphqlListValue { @@ -125,8 +125,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@159..172 "list_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@159..172 "list_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@172..174 ":" [] [Whitespace(" ")], value: GraphqlIntValue { @@ -140,8 +140,8 @@ GraphqlRoot { ], }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@182..195 "list_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@182..195 "list_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@195..197 ":" [] [Whitespace(" ")], value: GraphqlIntValue { @@ -156,16 +156,16 @@ GraphqlRoot { ], }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@206..221 "object_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@206..221 "object_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@221..223 ":" [] [Whitespace(" ")], value: GraphqlObjectValue { l_curly_token: L_CURLY@223..224 "{" [] [], members: GraphqlObjectValueMemberList [ GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@224..227 "key" [] [], + name: GraphqlLiteralName { + value_token: IDENT@224..227 "key" [] [], }, colon_token: COLON@227..229 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -173,16 +173,16 @@ GraphqlRoot { }, }, GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@236..251 "object_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@236..251 "object_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@251..253 ":" [] [Whitespace(" ")], value: GraphqlObjectValue { l_curly_token: L_CURLY@253..254 "{" [] [], members: GraphqlObjectValueMemberList [ GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@254..257 "key" [] [], + name: GraphqlLiteralName { + value_token: IDENT@254..257 "key" [] [], }, colon_token: COLON@257..258 ":" [] [], value: missing (required), @@ -192,16 +192,16 @@ GraphqlRoot { }, }, GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@259..274 "object_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@259..274 "object_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@274..276 ":" [] [Whitespace(" ")], value: GraphqlObjectValue { l_curly_token: L_CURLY@276..277 "{" [] [], members: GraphqlObjectValueMemberList [ GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@277..280 "key" [] [], + name: GraphqlLiteralName { + value_token: IDENT@277..280 "key" [] [], }, colon_token: missing (required), value: missing (required), @@ -211,13 +211,13 @@ GraphqlRoot { }, }, GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@281..296 "object_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@281..296 "object_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@296..298 ":" [] [Whitespace(" ")], value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@298..301 "key" [] [], + value: GraphqlLiteralName { + value_token: IDENT@298..301 "key" [] [], }, }, }, @@ -226,8 +226,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@302..317 "object_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@302..317 "object_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@317..319 ":" [] [Whitespace(" ")], value: GraphqlObjectValue { @@ -262,50 +262,50 @@ GraphqlRoot { 0: L_CURLY@0..1 "{" [] [] 1: GRAPHQL_SELECTION_LIST@1..323 0: GRAPHQL_BOGUS_SELECTION@1..323 - 0: GRAPHQL_NAME@1..14 - 0: GRAPHQL_NAME@1..14 "field_value" [Newline("\n"), Whitespace("\t")] [] + 0: GRAPHQL_LITERAL_NAME@1..14 + 0: IDENT@1..14 "field_value" [Newline("\n"), Whitespace("\t")] [] 1: GRAPHQL_BOGUS@14..323 0: L_PAREN@14..15 "(" [] [] 1: GRAPHQL_BOGUS@15..320 0: GRAPHQL_ARGUMENT@15..31 - 0: GRAPHQL_NAME@15..29 - 0: GRAPHQL_NAME@15..29 "float_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@15..29 + 0: IDENT@15..29 "float_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@29..31 ":" [] [Whitespace(" ")] 2: (empty) 1: GRAPHQL_BOGUS@31..37 0: ERROR_TOKEN@31..37 "1.1.1" [] [Skipped(",")] 2: GRAPHQL_ARGUMENT@37..62 - 0: GRAPHQL_NAME@37..52 - 0: GRAPHQL_NAME@37..52 "string_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@37..52 + 0: IDENT@37..52 "string_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@52..54 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@54..62 0: GRAPHQL_STRING_LITERAL@54..62 "\"string\"" [] [] 3: GRAPHQL_BOGUS@62..65 0: GRAPHQL_STRING_LITERAL@62..65 "\"\"" [] [Skipped(",")] 4: GRAPHQL_ARGUMENT@65..82 - 0: GRAPHQL_NAME@65..80 - 0: GRAPHQL_NAME@65..80 "string_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@65..80 + 0: IDENT@65..80 "string_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@80..82 ":" [] [Whitespace(" ")] 2: (empty) 5: GRAPHQL_BOGUS@82..90 0: ERROR_TOKEN@82..90 "\"string," [] [] 6: GRAPHQL_ARGUMENT@90..114 - 0: GRAPHQL_NAME@90..106 - 0: GRAPHQL_NAME@90..106 "boolean_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@90..106 + 0: IDENT@90..106 "boolean_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@106..108 ":" [] [Whitespace(" ")] 2: GRAPHQL_ENUM_VALUE@108..114 - 0: GRAPHQL_NAME@108..114 - 0: GRAPHQL_NAME@108..114 "truee" [] [Skipped(",")] + 0: GRAPHQL_LITERAL_NAME@108..114 + 0: IDENT@108..114 "truee" [] [Skipped(",")] 7: GRAPHQL_ARGUMENT@114..135 - 0: GRAPHQL_NAME@114..127 - 0: GRAPHQL_NAME@114..127 "null_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@114..127 + 0: IDENT@114..127 "null_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@127..129 ":" [] [Whitespace(" ")] 2: GRAPHQL_ENUM_VALUE@129..135 - 0: GRAPHQL_NAME@129..135 - 0: GRAPHQL_NAME@129..135 "nulll" [] [Skipped(",")] + 0: GRAPHQL_LITERAL_NAME@129..135 + 0: IDENT@129..135 "nulll" [] [Skipped(",")] 8: GRAPHQL_ARGUMENT@135..159 - 0: GRAPHQL_NAME@135..148 - 0: GRAPHQL_NAME@135..148 "list_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@135..148 + 0: IDENT@135..148 "list_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@148..150 ":" [] [Whitespace(" ")] 2: GRAPHQL_LIST_VALUE@150..159 0: L_BRACK@150..151 "[" [] [] @@ -318,8 +318,8 @@ GraphqlRoot { 0: GRAPHQL_INT_LITERAL@157..159 "3" [] [Skipped(",")] 2: (empty) 9: GRAPHQL_ARGUMENT@159..177 - 0: GRAPHQL_NAME@159..172 - 0: GRAPHQL_NAME@159..172 "list_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@159..172 + 0: IDENT@159..172 "list_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@172..174 ":" [] [Whitespace(" ")] 2: GRAPHQL_INT_VALUE@174..177 0: GRAPHQL_INT_LITERAL@174..177 "1" [] [Skipped(","), Whitespace(" ")] @@ -327,8 +327,8 @@ GraphqlRoot { 0: GRAPHQL_INT_LITERAL@177..180 "2" [] [Skipped(","), Whitespace(" ")] 1: GRAPHQL_INT_LITERAL@180..182 "3" [] [Skipped(",")] 11: GRAPHQL_ARGUMENT@182..200 - 0: GRAPHQL_NAME@182..195 - 0: GRAPHQL_NAME@182..195 "list_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@182..195 + 0: IDENT@182..195 "list_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@195..197 ":" [] [Whitespace(" ")] 2: GRAPHQL_INT_VALUE@197..200 0: GRAPHQL_INT_LITERAL@197..200 "1" [] [Skipped(","), Whitespace(" ")] @@ -337,55 +337,55 @@ GraphqlRoot { 1: GRAPHQL_INT_LITERAL@203..204 "3" [] [] 2: R_BRACK@204..206 "]" [] [Skipped(",")] 13: GRAPHQL_ARGUMENT@206..302 - 0: GRAPHQL_NAME@206..221 - 0: GRAPHQL_NAME@206..221 "object_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@206..221 + 0: IDENT@206..221 "object_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@221..223 ":" [] [Whitespace(" ")] 2: GRAPHQL_OBJECT_VALUE@223..302 0: L_CURLY@223..224 "{" [] [] 1: GRAPHQL_OBJECT_VALUE_MEMBER_LIST@224..301 0: GRAPHQL_OBJECT_FIELD@224..236 - 0: GRAPHQL_NAME@224..227 - 0: GRAPHQL_NAME@224..227 "key" [] [] + 0: GRAPHQL_LITERAL_NAME@224..227 + 0: IDENT@224..227 "key" [] [] 1: COLON@227..229 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@229..236 0: GRAPHQL_STRING_LITERAL@229..236 "\"value\"" [] [] 1: GRAPHQL_OBJECT_FIELD@236..259 - 0: GRAPHQL_NAME@236..251 - 0: GRAPHQL_NAME@236..251 "object_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@236..251 + 0: IDENT@236..251 "object_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@251..253 ":" [] [Whitespace(" ")] 2: GRAPHQL_OBJECT_VALUE@253..259 0: L_CURLY@253..254 "{" [] [] 1: GRAPHQL_OBJECT_VALUE_MEMBER_LIST@254..258 0: GRAPHQL_OBJECT_FIELD@254..258 - 0: GRAPHQL_NAME@254..257 - 0: GRAPHQL_NAME@254..257 "key" [] [] + 0: GRAPHQL_LITERAL_NAME@254..257 + 0: IDENT@254..257 "key" [] [] 1: COLON@257..258 ":" [] [] 2: (empty) 2: R_CURLY@258..259 "}" [] [] 2: GRAPHQL_OBJECT_FIELD@259..281 - 0: GRAPHQL_NAME@259..274 - 0: GRAPHQL_NAME@259..274 "object_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@259..274 + 0: IDENT@259..274 "object_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@274..276 ":" [] [Whitespace(" ")] 2: GRAPHQL_OBJECT_VALUE@276..281 0: L_CURLY@276..277 "{" [] [] 1: GRAPHQL_OBJECT_VALUE_MEMBER_LIST@277..280 0: GRAPHQL_OBJECT_FIELD@277..280 - 0: GRAPHQL_NAME@277..280 - 0: GRAPHQL_NAME@277..280 "key" [] [] + 0: GRAPHQL_LITERAL_NAME@277..280 + 0: IDENT@277..280 "key" [] [] 1: (empty) 2: (empty) 2: R_CURLY@280..281 "}" [] [] 3: GRAPHQL_OBJECT_FIELD@281..301 - 0: GRAPHQL_NAME@281..296 - 0: GRAPHQL_NAME@281..296 "object_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@281..296 + 0: IDENT@281..296 "object_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@296..298 ":" [] [Whitespace(" ")] 2: GRAPHQL_ENUM_VALUE@298..301 - 0: GRAPHQL_NAME@298..301 - 0: GRAPHQL_NAME@298..301 "key" [] [] + 0: GRAPHQL_LITERAL_NAME@298..301 + 0: IDENT@298..301 "key" [] [] 2: R_CURLY@301..302 "}" [] [] 14: GRAPHQL_ARGUMENT@302..320 - 0: GRAPHQL_NAME@302..317 - 0: GRAPHQL_NAME@302..317 "object_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@302..317 + 0: IDENT@302..317 "object_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@317..319 ":" [] [Whitespace(" ")] 2: GRAPHQL_OBJECT_VALUE@319..320 0: L_CURLY@319..320 "{" [] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/directive_definition.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/directive_definition.graphql.snap index 7602f92a163f..c5368e1941d8 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/directive_definition.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/directive_definition.graphql.snap @@ -29,8 +29,8 @@ GraphqlRoot { description: missing (optional), directive_token: DIRECTIVE_KW@0..10 "directive" [] [Whitespace(" ")], at_token: AT@10..11 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@11..19 "example" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@11..19 "example" [] [Whitespace(" ")], }, arguments: missing (optional), repeatable_token: missing (optional), @@ -46,8 +46,8 @@ GraphqlRoot { description: missing (optional), directive_token: DIRECTIVE_KW@27..39 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")], at_token: AT@39..40 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@40..48 "example" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@40..48 "example" [] [Whitespace(" ")], }, arguments: missing (optional), repeatable_token: missing (optional), @@ -67,8 +67,8 @@ GraphqlRoot { description: missing (optional), directive_token: DIRECTIVE_KW@89..101 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")], at_token: AT@101..102 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@102..110 "example" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@102..110 "example" [] [Whitespace(" ")], }, arguments: missing (optional), repeatable_token: missing (optional), @@ -96,23 +96,21 @@ GraphqlRoot { }, directive_token: DIRECTIVE_KW@177..187 "directive" [] [Whitespace(" ")], at_token: AT@187..188 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@188..201 "delegateField" [] [], + name: GraphqlNameBinding { + value_token: IDENT@188..201 "delegateField" [] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@201..202 "(" [] [], arguments: GraphqlArgumentDefinitionList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@202..206 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@202..206 "name" [] [], }, colon_token: COLON@206..208 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@208..214 "String" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@208..214 "String" [] [], }, excl_token: BANG@214..215 "!" [] [], }, @@ -139,22 +137,20 @@ GraphqlRoot { description: missing (optional), directive_token: DIRECTIVE_KW@249..261 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")], at_token: AT@261..262 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@262..271 "directive" [] [], + name: GraphqlNameBinding { + value_token: IDENT@262..271 "directive" [] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@271..272 "(" [] [], arguments: GraphqlArgumentDefinitionList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@272..281 "directive" [] [], + name: GraphqlLiteralName { + value_token: IDENT@272..281 "directive" [] [], }, colon_token: COLON@281..283 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@283..292 "directive" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@283..292 "directive" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -186,8 +182,8 @@ GraphqlRoot { 0: (empty) 1: DIRECTIVE_KW@0..10 "directive" [] [Whitespace(" ")] 2: AT@10..11 "@" [] [] - 3: GRAPHQL_NAME@11..19 - 0: GRAPHQL_NAME@11..19 "example" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_BINDING@11..19 + 0: IDENT@11..19 "example" [] [Whitespace(" ")] 4: (empty) 5: (empty) 6: ON_KW@19..22 "on" [] [Whitespace(" ")] @@ -199,8 +195,8 @@ GraphqlRoot { 0: (empty) 1: DIRECTIVE_KW@27..39 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: AT@39..40 "@" [] [] - 3: GRAPHQL_NAME@40..48 - 0: GRAPHQL_NAME@40..48 "example" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_BINDING@40..48 + 0: IDENT@40..48 "example" [] [Whitespace(" ")] 4: (empty) 5: (empty) 6: ON_KW@48..51 "on" [] [Whitespace(" ")] @@ -215,8 +211,8 @@ GraphqlRoot { 0: (empty) 1: DIRECTIVE_KW@89..101 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: AT@101..102 "@" [] [] - 3: GRAPHQL_NAME@102..110 - 0: GRAPHQL_NAME@102..110 "example" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_BINDING@102..110 + 0: IDENT@102..110 "example" [] [Whitespace(" ")] 4: (empty) 5: (empty) 6: ON_KW@110..112 "on" [] [] @@ -236,20 +232,19 @@ GraphqlRoot { 0: GRAPHQL_STRING_LITERAL@162..177 "\"deprecated\"" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: DIRECTIVE_KW@177..187 "directive" [] [Whitespace(" ")] 2: AT@187..188 "@" [] [] - 3: GRAPHQL_NAME@188..201 - 0: GRAPHQL_NAME@188..201 "delegateField" [] [] + 3: GRAPHQL_NAME_BINDING@188..201 + 0: IDENT@188..201 "delegateField" [] [] 4: GRAPHQL_ARGUMENTS_DEFINITION@201..217 0: L_PAREN@201..202 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@202..215 0: GRAPHQL_INPUT_VALUE_DEFINITION@202..215 0: (empty) - 1: GRAPHQL_NAME@202..206 - 0: GRAPHQL_NAME@202..206 "name" [] [] + 1: GRAPHQL_LITERAL_NAME@202..206 + 0: IDENT@202..206 "name" [] [] 2: COLON@206..208 ":" [] [Whitespace(" ")] 3: GRAPHQL_NON_NULL_TYPE@208..215 - 0: GRAPHQL_NAMED_TYPE@208..214 - 0: GRAPHQL_NAME@208..214 - 0: GRAPHQL_NAME@208..214 "String" [] [] + 0: GRAPHQL_NAME_REFERENCE@208..214 + 0: IDENT@208..214 "String" [] [] 1: BANG@214..215 "!" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@215..215 @@ -267,19 +262,18 @@ GraphqlRoot { 0: (empty) 1: DIRECTIVE_KW@249..261 "directive" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 2: AT@261..262 "@" [] [] - 3: GRAPHQL_NAME@262..271 - 0: GRAPHQL_NAME@262..271 "directive" [] [] + 3: GRAPHQL_NAME_BINDING@262..271 + 0: IDENT@262..271 "directive" [] [] 4: GRAPHQL_ARGUMENTS_DEFINITION@271..294 0: L_PAREN@271..272 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@272..292 0: GRAPHQL_INPUT_VALUE_DEFINITION@272..292 0: (empty) - 1: GRAPHQL_NAME@272..281 - 0: GRAPHQL_NAME@272..281 "directive" [] [] + 1: GRAPHQL_LITERAL_NAME@272..281 + 0: IDENT@272..281 "directive" [] [] 2: COLON@281..283 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@283..292 - 0: GRAPHQL_NAME@283..292 - 0: GRAPHQL_NAME@283..292 "directive" [] [] + 3: GRAPHQL_NAME_REFERENCE@283..292 + 0: IDENT@283..292 "directive" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@292..292 2: R_PAREN@292..294 ")" [] [Whitespace(" ")] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/enum.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/enum.graphql.snap index 22508e1a114c..cee8797f5d5c 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/enum.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/enum.graphql.snap @@ -36,8 +36,8 @@ GraphqlRoot { GraphqlEnumTypeDefinition { description: missing (optional), enum_token: ENUM_KW@0..5 "enum" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@5..10 "name" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@5..10 "name" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], enum_values: GraphqlEnumValuesDefinition { @@ -45,73 +45,57 @@ GraphqlRoot { values: GraphqlEnumValueList [ GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@11..19 "NORTH" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@11..19 "NORTH" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@19..26 "EAST" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@19..26 "EAST" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@26..34 "SOUTH" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@26..34 "SOUTH" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@34..41 "WEST" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@34..41 "WEST" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@41..49 "union" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@41..49 "union" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@49..56 "type" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@49..56 "type" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@56..68 "interface" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@56..68 "interface" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@68..75 "enum" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@68..75 "enum" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, @@ -122,8 +106,8 @@ GraphqlRoot { GraphqlEnumTypeDefinition { description: missing (optional), enum_token: ENUM_KW@77..84 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@84..94 "Direction" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@84..94 "Direction" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], enum_values: GraphqlEnumValuesDefinition { @@ -135,8 +119,8 @@ GraphqlRoot { GraphqlEnumTypeDefinition { description: missing (optional), enum_token: ENUM_KW@96..103 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@103..112 "Direction" [] [], + name: GraphqlNameBinding { + value_token: IDENT@103..112 "Direction" [] [], }, directives: GraphqlDirectiveList [], enum_values: missing (optional), @@ -144,14 +128,14 @@ GraphqlRoot { GraphqlEnumTypeDefinition { description: missing (optional), enum_token: ENUM_KW@112..119 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@119..129 "Direction" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@119..129 "Direction" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@129..130 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@130..141 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@130..141 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -165,16 +149,14 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@142..153 "\"north\"" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, }, - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@153..159 "NORTH" [] [Whitespace(" ")], - }, + value: GraphqlLiteralName { + value_token: IDENT@153..159 "NORTH" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@159..160 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@160..170 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@160..170 "deprecated" [] [], }, arguments: missing (optional), }, @@ -191,14 +173,14 @@ GraphqlRoot { }, }, enum_token: ENUM_KW@192..197 "enum" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@197..207 "Direction" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@197..207 "Direction" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@207..208 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@208..218 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@208..218 "deprecated" [] [], }, arguments: missing (optional), }, @@ -219,66 +201,58 @@ GraphqlRoot { 0: GRAPHQL_ENUM_TYPE_DEFINITION@0..77 0: (empty) 1: ENUM_KW@0..5 "enum" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@5..10 - 0: GRAPHQL_NAME@5..10 "name" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@5..10 + 0: IDENT@5..10 "name" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@10..10 4: GRAPHQL_ENUM_VALUES_DEFINITION@10..77 0: L_CURLY@10..11 "{" [] [] 1: GRAPHQL_ENUM_VALUE_LIST@11..75 0: GRAPHQL_ENUM_VALUE_DEFINITION@11..19 0: (empty) - 1: GRAPHQL_ENUM_VALUE@11..19 - 0: GRAPHQL_NAME@11..19 - 0: GRAPHQL_NAME@11..19 "NORTH" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@11..19 + 0: IDENT@11..19 "NORTH" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@19..19 1: GRAPHQL_ENUM_VALUE_DEFINITION@19..26 0: (empty) - 1: GRAPHQL_ENUM_VALUE@19..26 - 0: GRAPHQL_NAME@19..26 - 0: GRAPHQL_NAME@19..26 "EAST" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@19..26 + 0: IDENT@19..26 "EAST" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@26..26 2: GRAPHQL_ENUM_VALUE_DEFINITION@26..34 0: (empty) - 1: GRAPHQL_ENUM_VALUE@26..34 - 0: GRAPHQL_NAME@26..34 - 0: GRAPHQL_NAME@26..34 "SOUTH" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@26..34 + 0: IDENT@26..34 "SOUTH" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@34..34 3: GRAPHQL_ENUM_VALUE_DEFINITION@34..41 0: (empty) - 1: GRAPHQL_ENUM_VALUE@34..41 - 0: GRAPHQL_NAME@34..41 - 0: GRAPHQL_NAME@34..41 "WEST" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@34..41 + 0: IDENT@34..41 "WEST" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@41..41 4: GRAPHQL_ENUM_VALUE_DEFINITION@41..49 0: (empty) - 1: GRAPHQL_ENUM_VALUE@41..49 - 0: GRAPHQL_NAME@41..49 - 0: GRAPHQL_NAME@41..49 "union" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@41..49 + 0: IDENT@41..49 "union" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@49..49 5: GRAPHQL_ENUM_VALUE_DEFINITION@49..56 0: (empty) - 1: GRAPHQL_ENUM_VALUE@49..56 - 0: GRAPHQL_NAME@49..56 - 0: GRAPHQL_NAME@49..56 "type" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@49..56 + 0: IDENT@49..56 "type" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@56..56 6: GRAPHQL_ENUM_VALUE_DEFINITION@56..68 0: (empty) - 1: GRAPHQL_ENUM_VALUE@56..68 - 0: GRAPHQL_NAME@56..68 - 0: GRAPHQL_NAME@56..68 "interface" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@56..68 + 0: IDENT@56..68 "interface" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@68..68 7: GRAPHQL_ENUM_VALUE_DEFINITION@68..75 0: (empty) - 1: GRAPHQL_ENUM_VALUE@68..75 - 0: GRAPHQL_NAME@68..75 - 0: GRAPHQL_NAME@68..75 "enum" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@68..75 + 0: IDENT@68..75 "enum" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@75..75 2: R_CURLY@75..77 "}" [Newline("\n")] [] 1: GRAPHQL_ENUM_TYPE_DEFINITION@77..96 0: (empty) 1: ENUM_KW@77..84 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@84..94 - 0: GRAPHQL_NAME@84..94 "Direction" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@84..94 + 0: IDENT@84..94 "Direction" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@94..94 4: GRAPHQL_ENUM_VALUES_DEFINITION@94..96 0: L_CURLY@94..95 "{" [] [] @@ -287,20 +261,20 @@ GraphqlRoot { 2: GRAPHQL_ENUM_TYPE_DEFINITION@96..112 0: (empty) 1: ENUM_KW@96..103 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@103..112 - 0: GRAPHQL_NAME@103..112 "Direction" [] [] + 2: GRAPHQL_NAME_BINDING@103..112 + 0: IDENT@103..112 "Direction" [] [] 3: GRAPHQL_DIRECTIVE_LIST@112..112 4: (empty) 3: GRAPHQL_ENUM_TYPE_DEFINITION@112..172 0: (empty) 1: ENUM_KW@112..119 "enum" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@119..129 - 0: GRAPHQL_NAME@119..129 "Direction" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@119..129 + 0: IDENT@119..129 "Direction" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@129..141 0: GRAPHQL_DIRECTIVE@129..141 0: AT@129..130 "@" [] [] - 1: GRAPHQL_NAME@130..141 - 0: GRAPHQL_NAME@130..141 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@130..141 + 0: IDENT@130..141 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_ENUM_VALUES_DEFINITION@141..172 0: L_CURLY@141..142 "{" [] [] @@ -309,14 +283,13 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@142..153 0: GRAPHQL_STRING_VALUE@142..153 0: GRAPHQL_STRING_LITERAL@142..153 "\"north\"" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] - 1: GRAPHQL_ENUM_VALUE@153..159 - 0: GRAPHQL_NAME@153..159 - 0: GRAPHQL_NAME@153..159 "NORTH" [] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@153..159 + 0: IDENT@153..159 "NORTH" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@159..170 0: GRAPHQL_DIRECTIVE@159..170 0: AT@159..160 "@" [] [] - 1: GRAPHQL_NAME@160..170 - 0: GRAPHQL_NAME@160..170 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@160..170 + 0: IDENT@160..170 "deprecated" [] [] 2: (empty) 2: R_CURLY@170..172 "}" [Newline("\n")] [] 4: GRAPHQL_ENUM_TYPE_DEFINITION@172..218 @@ -324,13 +297,13 @@ GraphqlRoot { 0: GRAPHQL_STRING_VALUE@172..192 0: GRAPHQL_STRING_LITERAL@172..192 "\"This is an enum\"" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: ENUM_KW@192..197 "enum" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@197..207 - 0: GRAPHQL_NAME@197..207 "Direction" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@197..207 + 0: IDENT@197..207 "Direction" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@207..218 0: GRAPHQL_DIRECTIVE@207..218 0: AT@207..208 "@" [] [] - 1: GRAPHQL_NAME@208..218 - 0: GRAPHQL_NAME@208..218 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@208..218 + 0: IDENT@208..218 "deprecated" [] [] 2: (empty) 4: (empty) 2: EOF@218..219 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/enum_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/enum_extension.graphql.snap index 542d6b83df08..4071ef9d65d9 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/enum_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/enum_extension.graphql.snap @@ -25,14 +25,14 @@ GraphqlRoot { GraphqlEnumTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], enum_token: ENUM_KW@7..12 "enum" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@12..22 "Direction" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@12..22 "Direction" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@22..23 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@23..33 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@23..33 "deprecated" [] [], }, arguments: missing (optional), }, @@ -42,8 +42,8 @@ GraphqlRoot { GraphqlEnumTypeExtension { extend_token: EXTEND_KW@33..42 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], enum_token: ENUM_KW@42..47 "enum" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@47..57 "Direction" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@47..57 "Direction" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], enum_values: GraphqlEnumValuesDefinition { @@ -51,10 +51,8 @@ GraphqlRoot { values: GraphqlEnumValueList [ GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@58..66 "NORTH" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@58..66 "NORTH" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, @@ -65,14 +63,14 @@ GraphqlRoot { GraphqlEnumTypeExtension { extend_token: EXTEND_KW@68..77 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], enum_token: ENUM_KW@77..82 "enum" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@82..92 "Direction" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@82..92 "Direction" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@92..93 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@93..104 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@93..104 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -82,10 +80,8 @@ GraphqlRoot { values: GraphqlEnumValueList [ GraphqlEnumValueDefinition { description: missing (optional), - value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@105..113 "NORTH" [Newline("\n"), Whitespace(" ")] [], - }, + value: GraphqlLiteralName { + value_token: IDENT@105..113 "NORTH" [Newline("\n"), Whitespace(" ")] [], }, directives: GraphqlDirectiveList [], }, @@ -107,50 +103,48 @@ GraphqlRoot { 0: GRAPHQL_ENUM_TYPE_EXTENSION@0..33 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: ENUM_KW@7..12 "enum" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@12..22 - 0: GRAPHQL_NAME@12..22 "Direction" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@12..22 + 0: IDENT@12..22 "Direction" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@22..33 0: GRAPHQL_DIRECTIVE@22..33 0: AT@22..23 "@" [] [] - 1: GRAPHQL_NAME@23..33 - 0: GRAPHQL_NAME@23..33 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@23..33 + 0: IDENT@23..33 "deprecated" [] [] 2: (empty) 4: (empty) 1: GRAPHQL_ENUM_TYPE_EXTENSION@33..68 0: EXTEND_KW@33..42 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: ENUM_KW@42..47 "enum" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@47..57 - 0: GRAPHQL_NAME@47..57 "Direction" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@47..57 + 0: IDENT@47..57 "Direction" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@57..57 4: GRAPHQL_ENUM_VALUES_DEFINITION@57..68 0: L_CURLY@57..58 "{" [] [] 1: GRAPHQL_ENUM_VALUE_LIST@58..66 0: GRAPHQL_ENUM_VALUE_DEFINITION@58..66 0: (empty) - 1: GRAPHQL_ENUM_VALUE@58..66 - 0: GRAPHQL_NAME@58..66 - 0: GRAPHQL_NAME@58..66 "NORTH" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@58..66 + 0: IDENT@58..66 "NORTH" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@66..66 2: R_CURLY@66..68 "}" [Newline("\n")] [] 2: GRAPHQL_ENUM_TYPE_EXTENSION@68..115 0: EXTEND_KW@68..77 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: ENUM_KW@77..82 "enum" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@82..92 - 0: GRAPHQL_NAME@82..92 "Direction" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@82..92 + 0: IDENT@82..92 "Direction" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@92..104 0: GRAPHQL_DIRECTIVE@92..104 0: AT@92..93 "@" [] [] - 1: GRAPHQL_NAME@93..104 - 0: GRAPHQL_NAME@93..104 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@93..104 + 0: IDENT@93..104 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_ENUM_VALUES_DEFINITION@104..115 0: L_CURLY@104..105 "{" [] [] 1: GRAPHQL_ENUM_VALUE_LIST@105..113 0: GRAPHQL_ENUM_VALUE_DEFINITION@105..113 0: (empty) - 1: GRAPHQL_ENUM_VALUE@105..113 - 0: GRAPHQL_NAME@105..113 - 0: GRAPHQL_NAME@105..113 "NORTH" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@105..113 + 0: IDENT@105..113 "NORTH" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_DIRECTIVE_LIST@113..113 2: R_CURLY@113..115 "}" [Newline("\n")] [] 2: EOF@115..116 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/fragment.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/fragment.graphql.snap index cf440d54fcbe..9e254051f2d8 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/fragment.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/fragment.graphql.snap @@ -29,15 +29,13 @@ GraphqlRoot { definitions: GraphqlDefinitionList [ GraphqlFragmentDefinition { fragment_token: FRAGMENT_KW@0..9 "fragment" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@9..22 "friendFields" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@9..22 "friendFields" [] [Whitespace(" ")], }, type_condition: GraphqlTypeCondition { on_token: ON_KW@22..25 "on" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@25..30 "User" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@25..30 "User" [] [Whitespace(" ")], }, }, directives: GraphqlDirectiveList [], @@ -46,8 +44,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@31..36 "id" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@31..36 "id" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -55,8 +53,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@36..43 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@36..43 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -64,15 +62,15 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@43..56 "profilePic" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@43..56 "profilePic" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@56..57 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@57..61 "size" [] [], + name: GraphqlLiteralName { + value_token: IDENT@57..61 "size" [] [], }, colon_token: COLON@61..63 ":" [] [Whitespace(" ")], value: GraphqlIntValue { @@ -91,22 +89,20 @@ GraphqlRoot { }, GraphqlFragmentDefinition { fragment_token: FRAGMENT_KW@68..79 "fragment" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@79..92 "friendFields" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@79..92 "friendFields" [] [Whitespace(" ")], }, type_condition: GraphqlTypeCondition { on_token: ON_KW@92..95 "on" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@95..100 "User" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@95..100 "User" [] [Whitespace(" ")], }, }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@100..101 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@101..112 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@101..112 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -116,8 +112,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@113..118 "id" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@113..118 "id" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -125,8 +121,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@118..125 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@118..125 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -134,15 +130,15 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@125..138 "profilePic" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@125..138 "profilePic" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@138..139 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@139..143 "size" [] [], + name: GraphqlLiteralName { + value_token: IDENT@139..143 "size" [] [], }, colon_token: COLON@143..145 ":" [] [Whitespace(" ")], value: GraphqlIntValue { @@ -157,8 +153,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@148..156 "query" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@148..156 "query" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -167,8 +163,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@157..170 "fragment" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@157..170 "fragment" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -195,41 +191,40 @@ GraphqlRoot { 1: GRAPHQL_DEFINITION_LIST@0..175 0: GRAPHQL_FRAGMENT_DEFINITION@0..68 0: FRAGMENT_KW@0..9 "fragment" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@9..22 - 0: GRAPHQL_NAME@9..22 "friendFields" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@9..22 + 0: IDENT@9..22 "friendFields" [] [Whitespace(" ")] 2: GRAPHQL_TYPE_CONDITION@22..30 0: ON_KW@22..25 "on" [] [Whitespace(" ")] - 1: GRAPHQL_NAMED_TYPE@25..30 - 0: GRAPHQL_NAME@25..30 - 0: GRAPHQL_NAME@25..30 "User" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@25..30 + 0: IDENT@25..30 "User" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@30..30 4: GRAPHQL_SELECTION_SET@30..68 0: L_CURLY@30..31 "{" [] [] 1: GRAPHQL_SELECTION_LIST@31..66 0: GRAPHQL_FIELD@31..36 0: (empty) - 1: GRAPHQL_NAME@31..36 - 0: GRAPHQL_NAME@31..36 "id" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@31..36 + 0: IDENT@31..36 "id" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@36..36 4: (empty) 1: GRAPHQL_FIELD@36..43 0: (empty) - 1: GRAPHQL_NAME@36..43 - 0: GRAPHQL_NAME@36..43 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@36..43 + 0: IDENT@36..43 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@43..43 4: (empty) 2: GRAPHQL_FIELD@43..66 0: (empty) - 1: GRAPHQL_NAME@43..56 - 0: GRAPHQL_NAME@43..56 "profilePic" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@43..56 + 0: IDENT@43..56 "profilePic" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS@56..66 0: L_PAREN@56..57 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@57..65 0: GRAPHQL_ARGUMENT@57..65 - 0: GRAPHQL_NAME@57..61 - 0: GRAPHQL_NAME@57..61 "size" [] [] + 0: GRAPHQL_LITERAL_NAME@57..61 + 0: IDENT@57..61 "size" [] [] 1: COLON@61..63 ":" [] [Whitespace(" ")] 2: GRAPHQL_INT_VALUE@63..65 0: GRAPHQL_INT_LITERAL@63..65 "50" [] [] @@ -239,46 +234,45 @@ GraphqlRoot { 2: R_CURLY@66..68 "}" [Newline("\n")] [] 1: GRAPHQL_FRAGMENT_DEFINITION@68..175 0: FRAGMENT_KW@68..79 "fragment" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@79..92 - 0: GRAPHQL_NAME@79..92 "friendFields" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@79..92 + 0: IDENT@79..92 "friendFields" [] [Whitespace(" ")] 2: GRAPHQL_TYPE_CONDITION@92..100 0: ON_KW@92..95 "on" [] [Whitespace(" ")] - 1: GRAPHQL_NAMED_TYPE@95..100 - 0: GRAPHQL_NAME@95..100 - 0: GRAPHQL_NAME@95..100 "User" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@95..100 + 0: IDENT@95..100 "User" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@100..112 0: GRAPHQL_DIRECTIVE@100..112 0: AT@100..101 "@" [] [] - 1: GRAPHQL_NAME@101..112 - 0: GRAPHQL_NAME@101..112 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@101..112 + 0: IDENT@101..112 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_SELECTION_SET@112..175 0: L_CURLY@112..113 "{" [] [] 1: GRAPHQL_SELECTION_LIST@113..173 0: GRAPHQL_FIELD@113..118 0: (empty) - 1: GRAPHQL_NAME@113..118 - 0: GRAPHQL_NAME@113..118 "id" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@113..118 + 0: IDENT@113..118 "id" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@118..118 4: (empty) 1: GRAPHQL_FIELD@118..125 0: (empty) - 1: GRAPHQL_NAME@118..125 - 0: GRAPHQL_NAME@118..125 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@118..125 + 0: IDENT@118..125 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@125..125 4: (empty) 2: GRAPHQL_FIELD@125..148 0: (empty) - 1: GRAPHQL_NAME@125..138 - 0: GRAPHQL_NAME@125..138 "profilePic" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@125..138 + 0: IDENT@125..138 "profilePic" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS@138..148 0: L_PAREN@138..139 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@139..147 0: GRAPHQL_ARGUMENT@139..147 - 0: GRAPHQL_NAME@139..143 - 0: GRAPHQL_NAME@139..143 "size" [] [] + 0: GRAPHQL_LITERAL_NAME@139..143 + 0: IDENT@139..143 "size" [] [] 1: COLON@143..145 ":" [] [Whitespace(" ")] 2: GRAPHQL_INT_VALUE@145..147 0: GRAPHQL_INT_LITERAL@145..147 "50" [] [] @@ -287,8 +281,8 @@ GraphqlRoot { 4: (empty) 3: GRAPHQL_FIELD@148..173 0: (empty) - 1: GRAPHQL_NAME@148..156 - 0: GRAPHQL_NAME@148..156 "query" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@148..156 + 0: IDENT@148..156 "query" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@156..156 4: GRAPHQL_SELECTION_SET@156..173 @@ -296,8 +290,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@157..170 0: GRAPHQL_FIELD@157..170 0: (empty) - 1: GRAPHQL_NAME@157..170 - 0: GRAPHQL_NAME@157..170 "fragment" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@157..170 + 0: IDENT@157..170 "fragment" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@170..170 4: (empty) diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/input_object.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/input_object.graphql.snap index c0ac2ec06637..5e43978ed0e0 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/input_object.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/input_object.graphql.snap @@ -40,8 +40,8 @@ GraphqlRoot { GraphqlInputObjectTypeDefinition { description: missing (optional), input_token: INPUT_KW@0..6 "input" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@6..14 "Point2D" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@6..14 "Point2D" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], input_fields: GraphqlInputFieldsDefinition { @@ -49,28 +49,24 @@ GraphqlRoot { fields: GraphqlInputFieldList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@15..19 "x" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@15..19 "x" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@19..21 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@21..26 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@21..26 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], }, GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@26..30 "y" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@26..30 "y" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@30..32 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@32..37 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@32..37 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -82,8 +78,8 @@ GraphqlRoot { GraphqlInputObjectTypeDefinition { description: missing (optional), input_token: INPUT_KW@39..47 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@47..55 "Point2D" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@47..55 "Point2D" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], input_fields: GraphqlInputFieldsDefinition { @@ -95,8 +91,8 @@ GraphqlRoot { GraphqlInputObjectTypeDefinition { description: missing (optional), input_token: INPUT_KW@57..65 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@65..72 "Point2D" [] [], + name: GraphqlNameBinding { + value_token: IDENT@65..72 "Point2D" [] [], }, directives: GraphqlDirectiveList [], input_fields: missing (optional), @@ -104,14 +100,14 @@ GraphqlRoot { GraphqlInputObjectTypeDefinition { description: missing (optional), input_token: INPUT_KW@72..80 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@80..88 "Point2D" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@80..88 "Point2D" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@88..89 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@89..100 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@89..100 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -121,14 +117,12 @@ GraphqlRoot { fields: GraphqlInputFieldList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@101..104 "x" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@101..104 "x" [Newline("\n"), Whitespace("\t")] [], }, colon_token: COLON@104..106 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@106..111 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@106..111 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -144,14 +138,14 @@ GraphqlRoot { }, }, input_token: INPUT_KW@141..147 "input" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@147..155 "Point2D" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@147..155 "Point2D" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@155..156 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@156..166 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@156..166 "deprecated" [] [], }, arguments: missing (optional), }, @@ -161,8 +155,8 @@ GraphqlRoot { GraphqlInputObjectTypeDefinition { description: missing (optional), input_token: INPUT_KW@166..174 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@174..182 "Point2D" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@174..182 "Point2D" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], input_fields: GraphqlInputFieldsDefinition { @@ -170,14 +164,12 @@ GraphqlRoot { fields: GraphqlInputFieldList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@183..187 "x" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@183..187 "x" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@187..189 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@189..195 "Float" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@189..195 "Float" [] [Whitespace(" ")], }, default: GraphqlDefaultValue { eq_token: EQ@195..197 "=" [] [Whitespace(" ")], @@ -193,21 +185,19 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@198..213 "\"this is y\"" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@213..214 "y" [] [], + name: GraphqlLiteralName { + value_token: IDENT@213..214 "y" [] [], }, colon_token: COLON@214..216 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@216..222 "Float" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@216..222 "Float" [] [Whitespace(" ")], }, default: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@222..223 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@223..233 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@223..233 "deprecated" [] [], }, arguments: missing (optional), }, @@ -220,14 +210,14 @@ GraphqlRoot { GraphqlInputObjectTypeDefinition { description: missing (optional), input_token: INPUT_KW@235..243 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@243..249 "input" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@243..249 "input" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@249..250 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@250..256 "input" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@250..256 "input" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -237,14 +227,12 @@ GraphqlRoot { fields: GraphqlInputFieldList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@257..264 "input" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@257..264 "input" [Newline("\n"), Whitespace("\t")] [], }, colon_token: COLON@264..266 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@266..271 "input" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@266..271 "input" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -267,38 +255,36 @@ GraphqlRoot { 0: GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION@0..39 0: (empty) 1: INPUT_KW@0..6 "input" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@6..14 - 0: GRAPHQL_NAME@6..14 "Point2D" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@6..14 + 0: IDENT@6..14 "Point2D" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@14..14 4: GRAPHQL_INPUT_FIELDS_DEFINITION@14..39 0: L_CURLY@14..15 "{" [] [] 1: GRAPHQL_INPUT_FIELD_LIST@15..37 0: GRAPHQL_INPUT_VALUE_DEFINITION@15..26 0: (empty) - 1: GRAPHQL_NAME@15..19 - 0: GRAPHQL_NAME@15..19 "x" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@15..19 + 0: IDENT@15..19 "x" [Newline("\n"), Whitespace(" ")] [] 2: COLON@19..21 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@21..26 - 0: GRAPHQL_NAME@21..26 - 0: GRAPHQL_NAME@21..26 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@21..26 + 0: IDENT@21..26 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@26..26 1: GRAPHQL_INPUT_VALUE_DEFINITION@26..37 0: (empty) - 1: GRAPHQL_NAME@26..30 - 0: GRAPHQL_NAME@26..30 "y" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@26..30 + 0: IDENT@26..30 "y" [Newline("\n"), Whitespace(" ")] [] 2: COLON@30..32 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@32..37 - 0: GRAPHQL_NAME@32..37 - 0: GRAPHQL_NAME@32..37 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@32..37 + 0: IDENT@32..37 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@37..37 2: R_CURLY@37..39 "}" [Newline("\n")] [] 1: GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION@39..57 0: (empty) 1: INPUT_KW@39..47 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@47..55 - 0: GRAPHQL_NAME@47..55 "Point2D" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@47..55 + 0: IDENT@47..55 "Point2D" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@55..55 4: GRAPHQL_INPUT_FIELDS_DEFINITION@55..57 0: L_CURLY@55..56 "{" [] [] @@ -307,32 +293,31 @@ GraphqlRoot { 2: GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION@57..72 0: (empty) 1: INPUT_KW@57..65 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@65..72 - 0: GRAPHQL_NAME@65..72 "Point2D" [] [] + 2: GRAPHQL_NAME_BINDING@65..72 + 0: IDENT@65..72 "Point2D" [] [] 3: GRAPHQL_DIRECTIVE_LIST@72..72 4: (empty) 3: GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION@72..113 0: (empty) 1: INPUT_KW@72..80 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@80..88 - 0: GRAPHQL_NAME@80..88 "Point2D" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@80..88 + 0: IDENT@80..88 "Point2D" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@88..100 0: GRAPHQL_DIRECTIVE@88..100 0: AT@88..89 "@" [] [] - 1: GRAPHQL_NAME@89..100 - 0: GRAPHQL_NAME@89..100 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@89..100 + 0: IDENT@89..100 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_INPUT_FIELDS_DEFINITION@100..113 0: L_CURLY@100..101 "{" [] [] 1: GRAPHQL_INPUT_FIELD_LIST@101..111 0: GRAPHQL_INPUT_VALUE_DEFINITION@101..111 0: (empty) - 1: GRAPHQL_NAME@101..104 - 0: GRAPHQL_NAME@101..104 "x" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@101..104 + 0: IDENT@101..104 "x" [Newline("\n"), Whitespace("\t")] [] 2: COLON@104..106 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@106..111 - 0: GRAPHQL_NAME@106..111 - 0: GRAPHQL_NAME@106..111 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@106..111 + 0: IDENT@106..111 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@111..111 2: R_CURLY@111..113 "}" [Newline("\n")] [] @@ -341,32 +326,31 @@ GraphqlRoot { 0: GRAPHQL_STRING_VALUE@113..141 0: GRAPHQL_STRING_LITERAL@113..141 "\"This is an input object\"" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: INPUT_KW@141..147 "input" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@147..155 - 0: GRAPHQL_NAME@147..155 "Point2D" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@147..155 + 0: IDENT@147..155 "Point2D" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@155..166 0: GRAPHQL_DIRECTIVE@155..166 0: AT@155..156 "@" [] [] - 1: GRAPHQL_NAME@156..166 - 0: GRAPHQL_NAME@156..166 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@156..166 + 0: IDENT@156..166 "deprecated" [] [] 2: (empty) 4: (empty) 5: GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION@166..235 0: (empty) 1: INPUT_KW@166..174 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@174..182 - 0: GRAPHQL_NAME@174..182 "Point2D" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@174..182 + 0: IDENT@174..182 "Point2D" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@182..182 4: GRAPHQL_INPUT_FIELDS_DEFINITION@182..235 0: L_CURLY@182..183 "{" [] [] 1: GRAPHQL_INPUT_FIELD_LIST@183..233 0: GRAPHQL_INPUT_VALUE_DEFINITION@183..198 0: (empty) - 1: GRAPHQL_NAME@183..187 - 0: GRAPHQL_NAME@183..187 "x" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@183..187 + 0: IDENT@183..187 "x" [Newline("\n"), Whitespace(" ")] [] 2: COLON@187..189 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@189..195 - 0: GRAPHQL_NAME@189..195 - 0: GRAPHQL_NAME@189..195 "Float" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@189..195 + 0: IDENT@189..195 "Float" [] [Whitespace(" ")] 4: GRAPHQL_DEFAULT_VALUE@195..198 0: EQ@195..197 "=" [] [Whitespace(" ")] 1: GRAPHQL_INT_VALUE@197..198 @@ -376,42 +360,40 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@198..213 0: GRAPHQL_STRING_VALUE@198..213 0: GRAPHQL_STRING_LITERAL@198..213 "\"this is y\"" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] - 1: GRAPHQL_NAME@213..214 - 0: GRAPHQL_NAME@213..214 "y" [] [] + 1: GRAPHQL_LITERAL_NAME@213..214 + 0: IDENT@213..214 "y" [] [] 2: COLON@214..216 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@216..222 - 0: GRAPHQL_NAME@216..222 - 0: GRAPHQL_NAME@216..222 "Float" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@216..222 + 0: IDENT@216..222 "Float" [] [Whitespace(" ")] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@222..233 0: GRAPHQL_DIRECTIVE@222..233 0: AT@222..223 "@" [] [] - 1: GRAPHQL_NAME@223..233 - 0: GRAPHQL_NAME@223..233 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@223..233 + 0: IDENT@223..233 "deprecated" [] [] 2: (empty) 2: R_CURLY@233..235 "}" [Newline("\n")] [] 6: GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION@235..273 0: (empty) 1: INPUT_KW@235..243 "input" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@243..249 - 0: GRAPHQL_NAME@243..249 "input" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@243..249 + 0: IDENT@243..249 "input" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@249..256 0: GRAPHQL_DIRECTIVE@249..256 0: AT@249..250 "@" [] [] - 1: GRAPHQL_NAME@250..256 - 0: GRAPHQL_NAME@250..256 "input" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@250..256 + 0: IDENT@250..256 "input" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_INPUT_FIELDS_DEFINITION@256..273 0: L_CURLY@256..257 "{" [] [] 1: GRAPHQL_INPUT_FIELD_LIST@257..271 0: GRAPHQL_INPUT_VALUE_DEFINITION@257..271 0: (empty) - 1: GRAPHQL_NAME@257..264 - 0: GRAPHQL_NAME@257..264 "input" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@257..264 + 0: IDENT@257..264 "input" [Newline("\n"), Whitespace("\t")] [] 2: COLON@264..266 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@266..271 - 0: GRAPHQL_NAME@266..271 - 0: GRAPHQL_NAME@266..271 "input" [] [] + 3: GRAPHQL_NAME_REFERENCE@266..271 + 0: IDENT@266..271 "input" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@271..271 2: R_CURLY@271..273 "}" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/input_object_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/input_object_extension.graphql.snap index f6c805d074f8..e5a96fff88d4 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/input_object_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/input_object_extension.graphql.snap @@ -27,8 +27,8 @@ GraphqlRoot { GraphqlInputObjectTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], input_token: INPUT_KW@7..13 "input" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@13..21 "Point2D" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@13..21 "Point2D" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], input_fields: GraphqlInputFieldsDefinition { @@ -36,28 +36,24 @@ GraphqlRoot { fields: GraphqlInputFieldList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@22..26 "x" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@22..26 "x" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@26..28 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@28..33 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@28..33 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], }, GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@33..37 "y" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@33..37 "y" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@37..39 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@39..44 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@39..44 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -69,14 +65,14 @@ GraphqlRoot { GraphqlInputObjectTypeExtension { extend_token: EXTEND_KW@46..55 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], input_token: INPUT_KW@55..61 "input" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@61..69 "Point2D" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@61..69 "Point2D" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@69..70 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@70..80 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@70..80 "deprecated" [] [], }, arguments: missing (optional), }, @@ -86,14 +82,14 @@ GraphqlRoot { GraphqlInputObjectTypeExtension { extend_token: EXTEND_KW@80..89 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], input_token: INPUT_KW@89..95 "input" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@95..103 "Point2D" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@95..103 "Point2D" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@103..104 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@104..115 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@104..115 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -103,28 +99,24 @@ GraphqlRoot { fields: GraphqlInputFieldList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@116..120 "x" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@116..120 "x" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@120..122 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@122..127 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@122..127 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], }, GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@127..131 "y" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@127..131 "y" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@131..133 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@133..138 "Float" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@133..138 "Float" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -147,77 +139,73 @@ GraphqlRoot { 0: GRAPHQL_INPUT_OBJECT_TYPE_EXTENSION@0..46 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: INPUT_KW@7..13 "input" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@13..21 - 0: GRAPHQL_NAME@13..21 "Point2D" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@13..21 + 0: IDENT@13..21 "Point2D" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@21..21 4: GRAPHQL_INPUT_FIELDS_DEFINITION@21..46 0: L_CURLY@21..22 "{" [] [] 1: GRAPHQL_INPUT_FIELD_LIST@22..44 0: GRAPHQL_INPUT_VALUE_DEFINITION@22..33 0: (empty) - 1: GRAPHQL_NAME@22..26 - 0: GRAPHQL_NAME@22..26 "x" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@22..26 + 0: IDENT@22..26 "x" [Newline("\n"), Whitespace(" ")] [] 2: COLON@26..28 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@28..33 - 0: GRAPHQL_NAME@28..33 - 0: GRAPHQL_NAME@28..33 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@28..33 + 0: IDENT@28..33 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@33..33 1: GRAPHQL_INPUT_VALUE_DEFINITION@33..44 0: (empty) - 1: GRAPHQL_NAME@33..37 - 0: GRAPHQL_NAME@33..37 "y" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@33..37 + 0: IDENT@33..37 "y" [Newline("\n"), Whitespace(" ")] [] 2: COLON@37..39 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@39..44 - 0: GRAPHQL_NAME@39..44 - 0: GRAPHQL_NAME@39..44 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@39..44 + 0: IDENT@39..44 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@44..44 2: R_CURLY@44..46 "}" [Newline("\n")] [] 1: GRAPHQL_INPUT_OBJECT_TYPE_EXTENSION@46..80 0: EXTEND_KW@46..55 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: INPUT_KW@55..61 "input" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@61..69 - 0: GRAPHQL_NAME@61..69 "Point2D" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@61..69 + 0: IDENT@61..69 "Point2D" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@69..80 0: GRAPHQL_DIRECTIVE@69..80 0: AT@69..70 "@" [] [] - 1: GRAPHQL_NAME@70..80 - 0: GRAPHQL_NAME@70..80 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@70..80 + 0: IDENT@70..80 "deprecated" [] [] 2: (empty) 4: (empty) 2: GRAPHQL_INPUT_OBJECT_TYPE_EXTENSION@80..140 0: EXTEND_KW@80..89 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: INPUT_KW@89..95 "input" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@95..103 - 0: GRAPHQL_NAME@95..103 "Point2D" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@95..103 + 0: IDENT@95..103 "Point2D" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@103..115 0: GRAPHQL_DIRECTIVE@103..115 0: AT@103..104 "@" [] [] - 1: GRAPHQL_NAME@104..115 - 0: GRAPHQL_NAME@104..115 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@104..115 + 0: IDENT@104..115 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_INPUT_FIELDS_DEFINITION@115..140 0: L_CURLY@115..116 "{" [] [] 1: GRAPHQL_INPUT_FIELD_LIST@116..138 0: GRAPHQL_INPUT_VALUE_DEFINITION@116..127 0: (empty) - 1: GRAPHQL_NAME@116..120 - 0: GRAPHQL_NAME@116..120 "x" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@116..120 + 0: IDENT@116..120 "x" [Newline("\n"), Whitespace(" ")] [] 2: COLON@120..122 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@122..127 - 0: GRAPHQL_NAME@122..127 - 0: GRAPHQL_NAME@122..127 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@122..127 + 0: IDENT@122..127 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@127..127 1: GRAPHQL_INPUT_VALUE_DEFINITION@127..138 0: (empty) - 1: GRAPHQL_NAME@127..131 - 0: GRAPHQL_NAME@127..131 "y" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@127..131 + 0: IDENT@127..131 "y" [Newline("\n"), Whitespace(" ")] [] 2: COLON@131..133 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@133..138 - 0: GRAPHQL_NAME@133..138 - 0: GRAPHQL_NAME@133..138 "Float" [] [] + 3: GRAPHQL_NAME_REFERENCE@133..138 + 0: IDENT@133..138 "Float" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@138..138 2: R_CURLY@138..140 "}" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/interface.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/interface.graphql.snap index 55e505fb2b8e..e9e08a28672a 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/interface.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/interface.graphql.snap @@ -55,8 +55,8 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@0..10 "interface" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@10..17 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@10..17 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -65,43 +65,37 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@18..25 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@18..25 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@25..27 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@27..33 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@27..33 "String" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@33..39 "age" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@33..39 "age" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@39..41 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@41..44 "Int" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@41..44 "Int" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@44..54 "picture" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@44..54 "picture" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@54..56 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@56..59 "Url" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@56..59 "Url" [] [], }, directives: GraphqlDirectiveList [], }, @@ -112,15 +106,15 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@61..73 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@73..80 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@73..80 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@80..81 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@81..92 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@81..92 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -130,15 +124,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@93..100 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@93..100 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@100..102 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@102..108 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@102..108 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -149,25 +141,23 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@110..122 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@122..129 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@122..129 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@129..140 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@140..150 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@140..150 "Character" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@150..151 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@151..162 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@151..162 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -177,15 +167,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@163..170 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@163..170 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@170..172 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@172..178 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@172..178 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -196,17 +184,15 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@180..192 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@192..199 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@192..199 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@199..210 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@210..220 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@210..220 "Character" [] [Whitespace(" ")], }, ], }, @@ -216,15 +202,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@221..228 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@221..228 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@228..230 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@230..236 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@230..236 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -235,8 +219,8 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@238..250 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@250..256 "Person" [] [], + name: GraphqlNameBinding { + value_token: IDENT@250..256 "Person" [] [], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -245,17 +229,15 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@256..268 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@268..275 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@268..275 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@275..286 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@286..295 "Character" [] [], - }, + GraphqlNameReference { + value_token: IDENT@286..295 "Character" [] [], }, ], }, @@ -265,15 +247,15 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@295..307 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@307..314 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@307..314 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@314..315 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@315..325 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@315..325 "deprecated" [] [], }, arguments: missing (optional), }, @@ -283,25 +265,23 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@325..337 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@337..344 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@337..344 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@344..355 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@355..365 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@355..365 "Character" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@365..366 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@366..376 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@366..376 "deprecated" [] [], }, arguments: missing (optional), }, @@ -311,31 +291,27 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@376..388 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@388..395 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@388..395 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@395..406 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@406..416 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@406..416 "Character" [] [Whitespace(" ")], }, AMP@416..418 "&" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@418..429 "Character1" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@418..429 "Character1" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@429..430 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@430..440 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@430..440 "deprecated" [] [], }, arguments: missing (optional), }, @@ -345,8 +321,8 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@440..452 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@452..459 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@452..459 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -355,22 +331,20 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@460..467 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@460..467 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@467..468 "(" [] [], arguments: GraphqlArgumentDefinitionList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@468..478 "start_with" [] [], + name: GraphqlLiteralName { + value_token: IDENT@468..478 "start_with" [] [], }, colon_token: COLON@478..480 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@480..486 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@480..486 "String" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -379,10 +353,8 @@ GraphqlRoot { r_paren_token: R_PAREN@486..487 ")" [] [], }, colon_token: COLON@487..489 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@489..495 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@489..495 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -392,21 +364,19 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@495..514 "\"filder by age\"" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@514..517 "age" [] [], + name: GraphqlLiteralName { + value_token: IDENT@514..517 "age" [] [], }, arguments: missing (optional), colon_token: COLON@517..519 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@519..523 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@519..523 "Int" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@523..524 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@524..534 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@524..534 "deprecated" [] [], }, arguments: missing (optional), }, @@ -414,22 +384,20 @@ GraphqlRoot { }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@534..544 "picture" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@534..544 "picture" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@544..545 "(" [] [], arguments: GraphqlArgumentDefinitionList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@545..549 "size" [] [], + name: GraphqlLiteralName { + value_token: IDENT@545..549 "size" [] [], }, colon_token: COLON@549..551 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@551..555 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@551..555 "Int" [] [Whitespace(" ")], }, default: GraphqlDefaultValue { eq_token: EQ@555..557 "=" [] [Whitespace(" ")], @@ -443,17 +411,15 @@ GraphqlRoot { r_paren_token: R_PAREN@558..559 ")" [] [], }, colon_token: COLON@559..561 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@561..564 "Url" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@561..564 "Url" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@564..573 "height" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@564..573 "height" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@573..574 "(" [] [], @@ -464,21 +430,19 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@574..593 "\"filter by height\"" [] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@593..605 "greater_than" [] [], + name: GraphqlLiteralName { + value_token: IDENT@593..605 "greater_than" [] [], }, colon_token: COLON@605..607 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@607..611 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@607..611 "Int" [] [Whitespace(" ")], }, default: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@611..612 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@612..622 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@612..622 "deprecated" [] [], }, arguments: missing (optional), }, @@ -488,17 +452,15 @@ GraphqlRoot { r_paren_token: R_PAREN@622..623 ")" [] [], }, colon_token: COLON@623..625 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@625..628 "Int" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@625..628 "Int" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@628..637 "weight" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@628..637 "weight" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@637..638 "(" [] [], @@ -509,14 +471,12 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@638..657 "\"filter by weight\"" [] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@657..669 "greater_than" [] [], + name: GraphqlLiteralName { + value_token: IDENT@657..669 "greater_than" [] [], }, colon_token: COLON@669..671 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@671..675 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@671..675 "Int" [] [Whitespace(" ")], }, default: GraphqlDefaultValue { eq_token: EQ@675..677 "=" [] [Whitespace(" ")], @@ -527,8 +487,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@679..680 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@680..690 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@680..690 "deprecated" [] [], }, arguments: missing (optional), }, @@ -538,10 +498,8 @@ GraphqlRoot { r_paren_token: R_PAREN@690..691 ")" [] [], }, colon_token: COLON@691..693 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@693..696 "Int" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@693..696 "Int" [] [], }, directives: GraphqlDirectiveList [], }, @@ -552,17 +510,15 @@ GraphqlRoot { GraphqlInterfaceTypeDefinition { description: missing (optional), interface_token: INTERFACE_KW@698..710 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@710..720 "interface" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@710..720 "interface" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@720..731 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@731..741 "interface" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@731..741 "interface" [] [Whitespace(" ")], }, ], }, @@ -572,15 +528,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@742..754 "interface" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@742..754 "interface" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@754..756 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@756..765 "interface" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@756..765 "interface" [] [], }, directives: GraphqlDirectiveList [], }, @@ -602,8 +556,8 @@ GraphqlRoot { 0: GRAPHQL_INTERFACE_TYPE_DEFINITION@0..61 0: (empty) 1: INTERFACE_KW@0..10 "interface" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@10..17 - 0: GRAPHQL_NAME@10..17 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@10..17 + 0: IDENT@10..17 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@17..17 5: GRAPHQL_FIELDS_DEFINITION@17..61 @@ -611,202 +565,190 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@18..59 0: GRAPHQL_FIELD_DEFINITION@18..33 0: (empty) - 1: GRAPHQL_NAME@18..25 - 0: GRAPHQL_NAME@18..25 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@18..25 + 0: IDENT@18..25 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@25..27 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@27..33 - 0: GRAPHQL_NAME@27..33 - 0: GRAPHQL_NAME@27..33 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@27..33 + 0: IDENT@27..33 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@33..33 1: GRAPHQL_FIELD_DEFINITION@33..44 0: (empty) - 1: GRAPHQL_NAME@33..39 - 0: GRAPHQL_NAME@33..39 "age" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@33..39 + 0: IDENT@33..39 "age" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@39..41 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@41..44 - 0: GRAPHQL_NAME@41..44 - 0: GRAPHQL_NAME@41..44 "Int" [] [] + 4: GRAPHQL_NAME_REFERENCE@41..44 + 0: IDENT@41..44 "Int" [] [] 5: GRAPHQL_DIRECTIVE_LIST@44..44 2: GRAPHQL_FIELD_DEFINITION@44..59 0: (empty) - 1: GRAPHQL_NAME@44..54 - 0: GRAPHQL_NAME@44..54 "picture" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@44..54 + 0: IDENT@44..54 "picture" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@54..56 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@56..59 - 0: GRAPHQL_NAME@56..59 - 0: GRAPHQL_NAME@56..59 "Url" [] [] + 4: GRAPHQL_NAME_REFERENCE@56..59 + 0: IDENT@56..59 "Url" [] [] 5: GRAPHQL_DIRECTIVE_LIST@59..59 2: R_CURLY@59..61 "}" [Newline("\n")] [] 1: GRAPHQL_INTERFACE_TYPE_DEFINITION@61..110 0: (empty) 1: INTERFACE_KW@61..73 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@73..80 - 0: GRAPHQL_NAME@73..80 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@73..80 + 0: IDENT@73..80 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@80..92 0: GRAPHQL_DIRECTIVE@80..92 0: AT@80..81 "@" [] [] - 1: GRAPHQL_NAME@81..92 - 0: GRAPHQL_NAME@81..92 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@81..92 + 0: IDENT@81..92 "deprecated" [] [Whitespace(" ")] 2: (empty) 5: GRAPHQL_FIELDS_DEFINITION@92..110 0: L_CURLY@92..93 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@93..108 0: GRAPHQL_FIELD_DEFINITION@93..108 0: (empty) - 1: GRAPHQL_NAME@93..100 - 0: GRAPHQL_NAME@93..100 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@93..100 + 0: IDENT@93..100 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@100..102 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@102..108 - 0: GRAPHQL_NAME@102..108 - 0: GRAPHQL_NAME@102..108 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@102..108 + 0: IDENT@102..108 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@108..108 2: R_CURLY@108..110 "}" [Newline("\n")] [] 2: GRAPHQL_INTERFACE_TYPE_DEFINITION@110..180 0: (empty) 1: INTERFACE_KW@110..122 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@122..129 - 0: GRAPHQL_NAME@122..129 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@122..129 + 0: IDENT@122..129 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@129..150 0: IMPLEMENTS_KW@129..140 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@140..150 - 0: GRAPHQL_NAMED_TYPE@140..150 - 0: GRAPHQL_NAME@140..150 - 0: GRAPHQL_NAME@140..150 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@140..150 + 0: IDENT@140..150 "Character" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@150..162 0: GRAPHQL_DIRECTIVE@150..162 0: AT@150..151 "@" [] [] - 1: GRAPHQL_NAME@151..162 - 0: GRAPHQL_NAME@151..162 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@151..162 + 0: IDENT@151..162 "deprecated" [] [Whitespace(" ")] 2: (empty) 5: GRAPHQL_FIELDS_DEFINITION@162..180 0: L_CURLY@162..163 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@163..178 0: GRAPHQL_FIELD_DEFINITION@163..178 0: (empty) - 1: GRAPHQL_NAME@163..170 - 0: GRAPHQL_NAME@163..170 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@163..170 + 0: IDENT@163..170 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@170..172 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@172..178 - 0: GRAPHQL_NAME@172..178 - 0: GRAPHQL_NAME@172..178 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@172..178 + 0: IDENT@172..178 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@178..178 2: R_CURLY@178..180 "}" [Newline("\n")] [] 3: GRAPHQL_INTERFACE_TYPE_DEFINITION@180..238 0: (empty) 1: INTERFACE_KW@180..192 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@192..199 - 0: GRAPHQL_NAME@192..199 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@192..199 + 0: IDENT@192..199 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@199..220 0: IMPLEMENTS_KW@199..210 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@210..220 - 0: GRAPHQL_NAMED_TYPE@210..220 - 0: GRAPHQL_NAME@210..220 - 0: GRAPHQL_NAME@210..220 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@210..220 + 0: IDENT@210..220 "Character" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@220..220 5: GRAPHQL_FIELDS_DEFINITION@220..238 0: L_CURLY@220..221 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@221..236 0: GRAPHQL_FIELD_DEFINITION@221..236 0: (empty) - 1: GRAPHQL_NAME@221..228 - 0: GRAPHQL_NAME@221..228 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@221..228 + 0: IDENT@221..228 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@228..230 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@230..236 - 0: GRAPHQL_NAME@230..236 - 0: GRAPHQL_NAME@230..236 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@230..236 + 0: IDENT@230..236 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@236..236 2: R_CURLY@236..238 "}" [Newline("\n")] [] 4: GRAPHQL_INTERFACE_TYPE_DEFINITION@238..256 0: (empty) 1: INTERFACE_KW@238..250 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@250..256 - 0: GRAPHQL_NAME@250..256 "Person" [] [] + 2: GRAPHQL_NAME_BINDING@250..256 + 0: IDENT@250..256 "Person" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@256..256 5: (empty) 5: GRAPHQL_INTERFACE_TYPE_DEFINITION@256..295 0: (empty) 1: INTERFACE_KW@256..268 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@268..275 - 0: GRAPHQL_NAME@268..275 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@268..275 + 0: IDENT@268..275 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@275..295 0: IMPLEMENTS_KW@275..286 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@286..295 - 0: GRAPHQL_NAMED_TYPE@286..295 - 0: GRAPHQL_NAME@286..295 - 0: GRAPHQL_NAME@286..295 "Character" [] [] + 0: GRAPHQL_NAME_REFERENCE@286..295 + 0: IDENT@286..295 "Character" [] [] 4: GRAPHQL_DIRECTIVE_LIST@295..295 5: (empty) 6: GRAPHQL_INTERFACE_TYPE_DEFINITION@295..325 0: (empty) 1: INTERFACE_KW@295..307 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@307..314 - 0: GRAPHQL_NAME@307..314 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@307..314 + 0: IDENT@307..314 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@314..325 0: GRAPHQL_DIRECTIVE@314..325 0: AT@314..315 "@" [] [] - 1: GRAPHQL_NAME@315..325 - 0: GRAPHQL_NAME@315..325 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@315..325 + 0: IDENT@315..325 "deprecated" [] [] 2: (empty) 5: (empty) 7: GRAPHQL_INTERFACE_TYPE_DEFINITION@325..376 0: (empty) 1: INTERFACE_KW@325..337 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@337..344 - 0: GRAPHQL_NAME@337..344 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@337..344 + 0: IDENT@337..344 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@344..365 0: IMPLEMENTS_KW@344..355 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@355..365 - 0: GRAPHQL_NAMED_TYPE@355..365 - 0: GRAPHQL_NAME@355..365 - 0: GRAPHQL_NAME@355..365 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@355..365 + 0: IDENT@355..365 "Character" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@365..376 0: GRAPHQL_DIRECTIVE@365..376 0: AT@365..366 "@" [] [] - 1: GRAPHQL_NAME@366..376 - 0: GRAPHQL_NAME@366..376 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@366..376 + 0: IDENT@366..376 "deprecated" [] [] 2: (empty) 5: (empty) 8: GRAPHQL_INTERFACE_TYPE_DEFINITION@376..440 0: (empty) 1: INTERFACE_KW@376..388 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@388..395 - 0: GRAPHQL_NAME@388..395 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@388..395 + 0: IDENT@388..395 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@395..429 0: IMPLEMENTS_KW@395..406 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@406..429 - 0: GRAPHQL_NAMED_TYPE@406..416 - 0: GRAPHQL_NAME@406..416 - 0: GRAPHQL_NAME@406..416 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@406..416 + 0: IDENT@406..416 "Character" [] [Whitespace(" ")] 1: AMP@416..418 "&" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@418..429 - 0: GRAPHQL_NAME@418..429 - 0: GRAPHQL_NAME@418..429 "Character1" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@418..429 + 0: IDENT@418..429 "Character1" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@429..440 0: GRAPHQL_DIRECTIVE@429..440 0: AT@429..430 "@" [] [] - 1: GRAPHQL_NAME@430..440 - 0: GRAPHQL_NAME@430..440 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@430..440 + 0: IDENT@430..440 "deprecated" [] [] 2: (empty) 5: (empty) 9: GRAPHQL_INTERFACE_TYPE_DEFINITION@440..698 0: (empty) 1: INTERFACE_KW@440..452 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@452..459 - 0: GRAPHQL_NAME@452..459 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@452..459 + 0: IDENT@452..459 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@459..459 5: GRAPHQL_FIELDS_DEFINITION@459..698 @@ -814,59 +756,55 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@460..696 0: GRAPHQL_FIELD_DEFINITION@460..495 0: (empty) - 1: GRAPHQL_NAME@460..467 - 0: GRAPHQL_NAME@460..467 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@460..467 + 0: IDENT@460..467 "name" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@467..487 0: L_PAREN@467..468 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@468..486 0: GRAPHQL_INPUT_VALUE_DEFINITION@468..486 0: (empty) - 1: GRAPHQL_NAME@468..478 - 0: GRAPHQL_NAME@468..478 "start_with" [] [] + 1: GRAPHQL_LITERAL_NAME@468..478 + 0: IDENT@468..478 "start_with" [] [] 2: COLON@478..480 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@480..486 - 0: GRAPHQL_NAME@480..486 - 0: GRAPHQL_NAME@480..486 "String" [] [] + 3: GRAPHQL_NAME_REFERENCE@480..486 + 0: IDENT@480..486 "String" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@486..486 2: R_PAREN@486..487 ")" [] [] 3: COLON@487..489 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@489..495 - 0: GRAPHQL_NAME@489..495 - 0: GRAPHQL_NAME@489..495 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@489..495 + 0: IDENT@489..495 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@495..495 1: GRAPHQL_FIELD_DEFINITION@495..534 0: GRAPHQL_DESCRIPTION@495..514 0: GRAPHQL_STRING_VALUE@495..514 0: GRAPHQL_STRING_LITERAL@495..514 "\"filder by age\"" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] - 1: GRAPHQL_NAME@514..517 - 0: GRAPHQL_NAME@514..517 "age" [] [] + 1: GRAPHQL_LITERAL_NAME@514..517 + 0: IDENT@514..517 "age" [] [] 2: (empty) 3: COLON@517..519 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@519..523 - 0: GRAPHQL_NAME@519..523 - 0: GRAPHQL_NAME@519..523 "Int" [] [Whitespace(" ")] + 4: GRAPHQL_NAME_REFERENCE@519..523 + 0: IDENT@519..523 "Int" [] [Whitespace(" ")] 5: GRAPHQL_DIRECTIVE_LIST@523..534 0: GRAPHQL_DIRECTIVE@523..534 0: AT@523..524 "@" [] [] - 1: GRAPHQL_NAME@524..534 - 0: GRAPHQL_NAME@524..534 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@524..534 + 0: IDENT@524..534 "deprecated" [] [] 2: (empty) 2: GRAPHQL_FIELD_DEFINITION@534..564 0: (empty) - 1: GRAPHQL_NAME@534..544 - 0: GRAPHQL_NAME@534..544 "picture" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@534..544 + 0: IDENT@534..544 "picture" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@544..559 0: L_PAREN@544..545 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@545..558 0: GRAPHQL_INPUT_VALUE_DEFINITION@545..558 0: (empty) - 1: GRAPHQL_NAME@545..549 - 0: GRAPHQL_NAME@545..549 "size" [] [] + 1: GRAPHQL_LITERAL_NAME@545..549 + 0: IDENT@545..549 "size" [] [] 2: COLON@549..551 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@551..555 - 0: GRAPHQL_NAME@551..555 - 0: GRAPHQL_NAME@551..555 "Int" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@551..555 + 0: IDENT@551..555 "Int" [] [Whitespace(" ")] 4: GRAPHQL_DEFAULT_VALUE@555..558 0: EQ@555..557 "=" [] [Whitespace(" ")] 1: GRAPHQL_INT_VALUE@557..558 @@ -874,14 +812,13 @@ GraphqlRoot { 5: GRAPHQL_DIRECTIVE_LIST@558..558 2: R_PAREN@558..559 ")" [] [] 3: COLON@559..561 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@561..564 - 0: GRAPHQL_NAME@561..564 - 0: GRAPHQL_NAME@561..564 "Url" [] [] + 4: GRAPHQL_NAME_REFERENCE@561..564 + 0: IDENT@561..564 "Url" [] [] 5: GRAPHQL_DIRECTIVE_LIST@564..564 3: GRAPHQL_FIELD_DEFINITION@564..628 0: (empty) - 1: GRAPHQL_NAME@564..573 - 0: GRAPHQL_NAME@564..573 "height" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@564..573 + 0: IDENT@564..573 "height" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@573..623 0: L_PAREN@573..574 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@574..622 @@ -889,29 +826,27 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@574..593 0: GRAPHQL_STRING_VALUE@574..593 0: GRAPHQL_STRING_LITERAL@574..593 "\"filter by height\"" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@593..605 - 0: GRAPHQL_NAME@593..605 "greater_than" [] [] + 1: GRAPHQL_LITERAL_NAME@593..605 + 0: IDENT@593..605 "greater_than" [] [] 2: COLON@605..607 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@607..611 - 0: GRAPHQL_NAME@607..611 - 0: GRAPHQL_NAME@607..611 "Int" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@607..611 + 0: IDENT@607..611 "Int" [] [Whitespace(" ")] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@611..622 0: GRAPHQL_DIRECTIVE@611..622 0: AT@611..612 "@" [] [] - 1: GRAPHQL_NAME@612..622 - 0: GRAPHQL_NAME@612..622 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@612..622 + 0: IDENT@612..622 "deprecated" [] [] 2: (empty) 2: R_PAREN@622..623 ")" [] [] 3: COLON@623..625 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@625..628 - 0: GRAPHQL_NAME@625..628 - 0: GRAPHQL_NAME@625..628 "Int" [] [] + 4: GRAPHQL_NAME_REFERENCE@625..628 + 0: IDENT@625..628 "Int" [] [] 5: GRAPHQL_DIRECTIVE_LIST@628..628 4: GRAPHQL_FIELD_DEFINITION@628..696 0: (empty) - 1: GRAPHQL_NAME@628..637 - 0: GRAPHQL_NAME@628..637 "weight" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@628..637 + 0: IDENT@628..637 "weight" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@637..691 0: L_PAREN@637..638 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@638..690 @@ -919,12 +854,11 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@638..657 0: GRAPHQL_STRING_VALUE@638..657 0: GRAPHQL_STRING_LITERAL@638..657 "\"filter by weight\"" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@657..669 - 0: GRAPHQL_NAME@657..669 "greater_than" [] [] + 1: GRAPHQL_LITERAL_NAME@657..669 + 0: IDENT@657..669 "greater_than" [] [] 2: COLON@669..671 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@671..675 - 0: GRAPHQL_NAME@671..675 - 0: GRAPHQL_NAME@671..675 "Int" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@671..675 + 0: IDENT@671..675 "Int" [] [Whitespace(" ")] 4: GRAPHQL_DEFAULT_VALUE@675..679 0: EQ@675..677 "=" [] [Whitespace(" ")] 1: GRAPHQL_INT_VALUE@677..679 @@ -932,41 +866,38 @@ GraphqlRoot { 5: GRAPHQL_DIRECTIVE_LIST@679..690 0: GRAPHQL_DIRECTIVE@679..690 0: AT@679..680 "@" [] [] - 1: GRAPHQL_NAME@680..690 - 0: GRAPHQL_NAME@680..690 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@680..690 + 0: IDENT@680..690 "deprecated" [] [] 2: (empty) 2: R_PAREN@690..691 ")" [] [] 3: COLON@691..693 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@693..696 - 0: GRAPHQL_NAME@693..696 - 0: GRAPHQL_NAME@693..696 "Int" [] [] + 4: GRAPHQL_NAME_REFERENCE@693..696 + 0: IDENT@693..696 "Int" [] [] 5: GRAPHQL_DIRECTIVE_LIST@696..696 2: R_CURLY@696..698 "}" [Newline("\n")] [] 10: GRAPHQL_INTERFACE_TYPE_DEFINITION@698..767 0: (empty) 1: INTERFACE_KW@698..710 "interface" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@710..720 - 0: GRAPHQL_NAME@710..720 "interface" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@710..720 + 0: IDENT@710..720 "interface" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@720..741 0: IMPLEMENTS_KW@720..731 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@731..741 - 0: GRAPHQL_NAMED_TYPE@731..741 - 0: GRAPHQL_NAME@731..741 - 0: GRAPHQL_NAME@731..741 "interface" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@731..741 + 0: IDENT@731..741 "interface" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@741..741 5: GRAPHQL_FIELDS_DEFINITION@741..767 0: L_CURLY@741..742 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@742..765 0: GRAPHQL_FIELD_DEFINITION@742..765 0: (empty) - 1: GRAPHQL_NAME@742..754 - 0: GRAPHQL_NAME@742..754 "interface" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@742..754 + 0: IDENT@742..754 "interface" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@754..756 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@756..765 - 0: GRAPHQL_NAME@756..765 - 0: GRAPHQL_NAME@756..765 "interface" [] [] + 4: GRAPHQL_NAME_REFERENCE@756..765 + 0: IDENT@756..765 "interface" [] [] 5: GRAPHQL_DIRECTIVE_LIST@765..765 2: R_CURLY@765..767 "}" [Newline("\n")] [] 2: EOF@767..768 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/interface_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/interface_extension.graphql.snap index da9bdbf7bc97..c2f29a1b3f7a 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/interface_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/interface_extension.graphql.snap @@ -33,8 +33,8 @@ GraphqlRoot { GraphqlInterfaceTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], interface_token: INTERFACE_KW@7..17 "interface" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@17..23 "Story" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@17..23 "Story" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -43,15 +43,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@24..42 "isHiddenLocally" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@24..42 "isHiddenLocally" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@42..44 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@44..51 "Boolean" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@44..51 "Boolean" [] [], }, directives: GraphqlDirectiveList [], }, @@ -62,15 +60,15 @@ GraphqlRoot { GraphqlInterfaceTypeExtension { extend_token: EXTEND_KW@53..62 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], interface_token: INTERFACE_KW@62..72 "interface" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@72..77 "User" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@72..77 "User" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@77..78 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@78..92 "addedDirective" [] [], + name: GraphqlNameReference { + value_token: IDENT@78..92 "addedDirective" [] [], }, arguments: missing (optional), }, @@ -80,17 +78,15 @@ GraphqlRoot { GraphqlInterfaceTypeExtension { extend_token: EXTEND_KW@92..101 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], interface_token: INTERFACE_KW@101..111 "interface" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@111..116 "User" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@111..116 "User" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@116..127 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@127..136 "Character" [] [], - }, + GraphqlNameReference { + value_token: IDENT@127..136 "Character" [] [], }, ], }, @@ -100,25 +96,23 @@ GraphqlRoot { GraphqlInterfaceTypeExtension { extend_token: EXTEND_KW@136..145 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], interface_token: INTERFACE_KW@145..155 "interface" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@155..160 "User" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@155..160 "User" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@160..171 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@171..181 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@171..181 "Character" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@181..182 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@182..192 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@182..192 "deprecated" [] [], }, arguments: missing (optional), }, @@ -128,15 +122,15 @@ GraphqlRoot { GraphqlInterfaceTypeExtension { extend_token: EXTEND_KW@192..201 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], interface_token: INTERFACE_KW@201..211 "interface" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@211..216 "User" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@211..216 "User" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@216..217 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@217..228 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@217..228 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -146,15 +140,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@229..236 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@229..236 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@236..238 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@238..244 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@238..244 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -165,25 +157,23 @@ GraphqlRoot { GraphqlInterfaceTypeExtension { extend_token: EXTEND_KW@246..255 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], interface_token: INTERFACE_KW@255..265 "interface" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@265..270 "User" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@265..270 "User" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@270..281 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@281..291 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@281..291 "Character" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@291..292 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@292..303 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@292..303 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -193,15 +183,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@304..311 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@304..311 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@311..313 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@313..319 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@313..319 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -223,8 +211,8 @@ GraphqlRoot { 0: GRAPHQL_INTERFACE_TYPE_EXTENSION@0..53 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: INTERFACE_KW@7..17 "interface" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@17..23 - 0: GRAPHQL_NAME@17..23 "Story" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@17..23 + 0: IDENT@17..23 "Story" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@23..23 5: GRAPHQL_FIELDS_DEFINITION@23..53 @@ -232,117 +220,111 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@24..51 0: GRAPHQL_FIELD_DEFINITION@24..51 0: (empty) - 1: GRAPHQL_NAME@24..42 - 0: GRAPHQL_NAME@24..42 "isHiddenLocally" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@24..42 + 0: IDENT@24..42 "isHiddenLocally" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@42..44 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@44..51 - 0: GRAPHQL_NAME@44..51 - 0: GRAPHQL_NAME@44..51 "Boolean" [] [] + 4: GRAPHQL_NAME_REFERENCE@44..51 + 0: IDENT@44..51 "Boolean" [] [] 5: GRAPHQL_DIRECTIVE_LIST@51..51 2: R_CURLY@51..53 "}" [Newline("\n")] [] 1: GRAPHQL_INTERFACE_TYPE_EXTENSION@53..92 0: EXTEND_KW@53..62 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: INTERFACE_KW@62..72 "interface" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@72..77 - 0: GRAPHQL_NAME@72..77 "User" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@72..77 + 0: IDENT@72..77 "User" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@77..92 0: GRAPHQL_DIRECTIVE@77..92 0: AT@77..78 "@" [] [] - 1: GRAPHQL_NAME@78..92 - 0: GRAPHQL_NAME@78..92 "addedDirective" [] [] + 1: GRAPHQL_NAME_REFERENCE@78..92 + 0: IDENT@78..92 "addedDirective" [] [] 2: (empty) 5: (empty) 2: GRAPHQL_INTERFACE_TYPE_EXTENSION@92..136 0: EXTEND_KW@92..101 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: INTERFACE_KW@101..111 "interface" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@111..116 - 0: GRAPHQL_NAME@111..116 "User" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@111..116 + 0: IDENT@111..116 "User" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@116..136 0: IMPLEMENTS_KW@116..127 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@127..136 - 0: GRAPHQL_NAMED_TYPE@127..136 - 0: GRAPHQL_NAME@127..136 - 0: GRAPHQL_NAME@127..136 "Character" [] [] + 0: GRAPHQL_NAME_REFERENCE@127..136 + 0: IDENT@127..136 "Character" [] [] 4: GRAPHQL_DIRECTIVE_LIST@136..136 5: (empty) 3: GRAPHQL_INTERFACE_TYPE_EXTENSION@136..192 0: EXTEND_KW@136..145 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: INTERFACE_KW@145..155 "interface" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@155..160 - 0: GRAPHQL_NAME@155..160 "User" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@155..160 + 0: IDENT@155..160 "User" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@160..181 0: IMPLEMENTS_KW@160..171 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@171..181 - 0: GRAPHQL_NAMED_TYPE@171..181 - 0: GRAPHQL_NAME@171..181 - 0: GRAPHQL_NAME@171..181 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@171..181 + 0: IDENT@171..181 "Character" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@181..192 0: GRAPHQL_DIRECTIVE@181..192 0: AT@181..182 "@" [] [] - 1: GRAPHQL_NAME@182..192 - 0: GRAPHQL_NAME@182..192 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@182..192 + 0: IDENT@182..192 "deprecated" [] [] 2: (empty) 5: (empty) 4: GRAPHQL_INTERFACE_TYPE_EXTENSION@192..246 0: EXTEND_KW@192..201 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: INTERFACE_KW@201..211 "interface" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@211..216 - 0: GRAPHQL_NAME@211..216 "User" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@211..216 + 0: IDENT@211..216 "User" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@216..228 0: GRAPHQL_DIRECTIVE@216..228 0: AT@216..217 "@" [] [] - 1: GRAPHQL_NAME@217..228 - 0: GRAPHQL_NAME@217..228 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@217..228 + 0: IDENT@217..228 "deprecated" [] [Whitespace(" ")] 2: (empty) 5: GRAPHQL_FIELDS_DEFINITION@228..246 0: L_CURLY@228..229 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@229..244 0: GRAPHQL_FIELD_DEFINITION@229..244 0: (empty) - 1: GRAPHQL_NAME@229..236 - 0: GRAPHQL_NAME@229..236 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@229..236 + 0: IDENT@229..236 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@236..238 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@238..244 - 0: GRAPHQL_NAME@238..244 - 0: GRAPHQL_NAME@238..244 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@238..244 + 0: IDENT@238..244 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@244..244 2: R_CURLY@244..246 "}" [Newline("\n")] [] 5: GRAPHQL_INTERFACE_TYPE_EXTENSION@246..321 0: EXTEND_KW@246..255 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: INTERFACE_KW@255..265 "interface" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@265..270 - 0: GRAPHQL_NAME@265..270 "User" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@265..270 + 0: IDENT@265..270 "User" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@270..291 0: IMPLEMENTS_KW@270..281 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@281..291 - 0: GRAPHQL_NAMED_TYPE@281..291 - 0: GRAPHQL_NAME@281..291 - 0: GRAPHQL_NAME@281..291 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@281..291 + 0: IDENT@281..291 "Character" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@291..303 0: GRAPHQL_DIRECTIVE@291..303 0: AT@291..292 "@" [] [] - 1: GRAPHQL_NAME@292..303 - 0: GRAPHQL_NAME@292..303 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@292..303 + 0: IDENT@292..303 "deprecated" [] [Whitespace(" ")] 2: (empty) 5: GRAPHQL_FIELDS_DEFINITION@303..321 0: L_CURLY@303..304 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@304..319 0: GRAPHQL_FIELD_DEFINITION@304..319 0: (empty) - 1: GRAPHQL_NAME@304..311 - 0: GRAPHQL_NAME@304..311 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@304..311 + 0: IDENT@304..311 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@311..313 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@313..319 - 0: GRAPHQL_NAME@313..319 - 0: GRAPHQL_NAME@313..319 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@313..319 + 0: IDENT@313..319 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@319..319 2: R_CURLY@319..321 "}" [Newline("\n")] [] 2: EOF@321..322 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/object.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/object.graphql.snap index 366666a63d79..4343a5a7fa73 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/object.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/object.graphql.snap @@ -65,8 +65,8 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@0..5 "type" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@5..12 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@5..12 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -75,43 +75,37 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@13..20 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@13..20 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@20..22 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@22..28 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@22..28 "String" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@28..34 "age" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@28..34 "age" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@34..36 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@36..39 "Int" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@36..39 "Int" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@39..49 "picture" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@39..49 "picture" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@49..51 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@51..54 "Url" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@51..54 "Url" [] [], }, directives: GraphqlDirectiveList [], }, @@ -122,15 +116,15 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@56..63 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@63..70 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@63..70 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@70..71 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@71..82 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@71..82 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -140,15 +134,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@83..90 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@83..90 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@90..92 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@92..98 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@92..98 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -159,8 +151,8 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@100..107 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@107..114 "Animal" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@107..114 "Animal" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -173,15 +165,13 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@115..138 "\"type of the animal\"" [Newline("\n"), Whitespace(" ")] [], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@138..145 "type" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@138..145 "type" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@145..147 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@147..153 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@147..153 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -192,25 +182,23 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@155..162 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@162..169 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@162..169 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@169..180 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@180..190 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@180..190 "Character" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@190..191 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@191..202 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@191..202 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -220,15 +208,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@203..210 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@203..210 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@210..212 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@212..218 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@212..218 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -239,17 +225,15 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@220..227 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@227..234 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@227..234 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@234..245 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@245..255 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@245..255 "Character" [] [Whitespace(" ")], }, ], }, @@ -259,15 +243,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@256..263 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@256..263 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@263..265 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@265..271 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@265..271 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -278,8 +260,8 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@273..280 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@280..286 "Person" [] [], + name: GraphqlNameBinding { + value_token: IDENT@280..286 "Person" [] [], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -288,17 +270,15 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@286..293 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@293..300 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@293..300 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@300..311 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@311..320 "Character" [] [], - }, + GraphqlNameReference { + value_token: IDENT@311..320 "Character" [] [], }, ], }, @@ -308,23 +288,19 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@320..327 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@327..334 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@327..334 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@334..345 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@345..355 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@345..355 "Character" [] [Whitespace(" ")], }, AMP@355..357 "&" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@357..361 "type" [] [], - }, + GraphqlNameReference { + value_token: IDENT@357..361 "type" [] [], }, ], }, @@ -334,15 +310,15 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@361..368 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@368..375 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@368..375 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@375..376 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@376..386 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@376..386 "deprecated" [] [], }, arguments: missing (optional), }, @@ -352,25 +328,23 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@386..393 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@393..400 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@393..400 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@400..411 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@411..421 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@411..421 "Character" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@421..422 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@422..432 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@422..432 "deprecated" [] [], }, arguments: missing (optional), }, @@ -380,31 +354,27 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@432..439 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@439..446 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@439..446 "Person" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@446..457 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@457..467 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@457..467 "Character" [] [Whitespace(" ")], }, AMP@467..469 "&" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@469..480 "Character1" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@469..480 "Character1" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@480..481 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@481..491 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@481..491 "deprecated" [] [], }, arguments: missing (optional), }, @@ -418,8 +388,8 @@ GraphqlRoot { }, }, type_token: TYPE_KW@511..517 "type" [Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@517..524 "Person" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@517..524 "Person" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -428,22 +398,20 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@525..532 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@525..532 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@532..533 "(" [] [], arguments: GraphqlArgumentDefinitionList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@533..543 "start_with" [] [], + name: GraphqlLiteralName { + value_token: IDENT@533..543 "start_with" [] [], }, colon_token: COLON@543..545 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@545..551 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@545..551 "String" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -452,10 +420,8 @@ GraphqlRoot { r_paren_token: R_PAREN@551..552 ")" [] [], }, colon_token: COLON@552..554 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@554..560 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@554..560 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -465,21 +431,19 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@560..579 "\"filder by age\"" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@579..582 "age" [] [], + name: GraphqlLiteralName { + value_token: IDENT@579..582 "age" [] [], }, arguments: missing (optional), colon_token: COLON@582..584 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@584..588 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@584..588 "Int" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@588..589 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@589..599 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@589..599 "deprecated" [] [], }, arguments: missing (optional), }, @@ -487,22 +451,20 @@ GraphqlRoot { }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@599..609 "picture" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@599..609 "picture" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@609..610 "(" [] [], arguments: GraphqlArgumentDefinitionList [ GraphqlInputValueDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@610..614 "size" [] [], + name: GraphqlLiteralName { + value_token: IDENT@610..614 "size" [] [], }, colon_token: COLON@614..616 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@616..620 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@616..620 "Int" [] [Whitespace(" ")], }, default: GraphqlDefaultValue { eq_token: EQ@620..622 "=" [] [Whitespace(" ")], @@ -516,17 +478,15 @@ GraphqlRoot { r_paren_token: R_PAREN@623..624 ")" [] [], }, colon_token: COLON@624..626 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@626..629 "Url" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@626..629 "Url" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@629..638 "height" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@629..638 "height" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@638..639 "(" [] [], @@ -537,21 +497,19 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@639..658 "\"filter by height\"" [] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@658..670 "greater_than" [] [], + name: GraphqlLiteralName { + value_token: IDENT@658..670 "greater_than" [] [], }, colon_token: COLON@670..672 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@672..676 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@672..676 "Int" [] [Whitespace(" ")], }, default: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@676..677 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@677..687 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@677..687 "deprecated" [] [], }, arguments: missing (optional), }, @@ -561,17 +519,15 @@ GraphqlRoot { r_paren_token: R_PAREN@687..688 ")" [] [], }, colon_token: COLON@688..690 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@690..693 "Int" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@690..693 "Int" [] [], }, directives: GraphqlDirectiveList [], }, GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@693..702 "weight" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@693..702 "weight" [Newline("\n"), Whitespace(" ")] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@702..703 "(" [] [], @@ -582,14 +538,12 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@703..722 "\"filter by weight\"" [] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@722..734 "greater_than" [] [], + name: GraphqlLiteralName { + value_token: IDENT@722..734 "greater_than" [] [], }, colon_token: COLON@734..736 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@736..740 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@736..740 "Int" [] [Whitespace(" ")], }, default: GraphqlDefaultValue { eq_token: EQ@740..742 "=" [] [Whitespace(" ")], @@ -600,8 +554,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@744..745 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@745..755 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@745..755 "deprecated" [] [], }, arguments: missing (optional), }, @@ -611,10 +565,8 @@ GraphqlRoot { r_paren_token: R_PAREN@755..756 ")" [] [], }, colon_token: COLON@756..758 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@758..761 "Int" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@758..761 "Int" [] [], }, directives: GraphqlDirectiveList [], }, @@ -624,8 +576,8 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@761..783 "\"filter by weight\"" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@783..789 "weight" [] [], + name: GraphqlLiteralName { + value_token: IDENT@783..789 "weight" [] [], }, arguments: GraphqlArgumentsDefinition { l_paren_token: L_PAREN@789..790 "(" [] [], @@ -636,14 +588,12 @@ GraphqlRoot { graphql_string_literal_token: GRAPHQL_STRING_LITERAL@790..809 "\"filter by weight\"" [] [Whitespace(" ")], }, }, - name: GraphqlName { - value_token: GRAPHQL_NAME@809..821 "greater_than" [] [], + name: GraphqlLiteralName { + value_token: IDENT@809..821 "greater_than" [] [], }, colon_token: COLON@821..823 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@823..827 "Int" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@823..827 "Int" [] [Whitespace(" ")], }, default: GraphqlDefaultValue { eq_token: EQ@827..829 "=" [] [Whitespace(" ")], @@ -654,8 +604,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@831..832 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@832..842 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@832..842 "deprecated" [] [], }, arguments: missing (optional), }, @@ -665,10 +615,8 @@ GraphqlRoot { r_paren_token: R_PAREN@842..843 ")" [] [], }, colon_token: COLON@843..845 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@845..848 "Int" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@845..848 "Int" [] [], }, directives: GraphqlDirectiveList [], }, @@ -679,17 +627,15 @@ GraphqlRoot { GraphqlObjectTypeDefinition { description: missing (optional), type_token: TYPE_KW@850..857 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@857..862 "type" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@857..862 "type" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@862..873 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@873..878 "type" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@873..878 "type" [] [Whitespace(" ")], }, ], }, @@ -699,15 +645,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@879..886 "type" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@879..886 "type" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@886..888 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@888..892 "type" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@888..892 "type" [] [], }, directives: GraphqlDirectiveList [], }, @@ -729,8 +673,8 @@ GraphqlRoot { 0: GRAPHQL_OBJECT_TYPE_DEFINITION@0..56 0: (empty) 1: TYPE_KW@0..5 "type" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@5..12 - 0: GRAPHQL_NAME@5..12 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@5..12 + 0: IDENT@5..12 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@12..12 5: GRAPHQL_FIELDS_DEFINITION@12..56 @@ -738,66 +682,62 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@13..54 0: GRAPHQL_FIELD_DEFINITION@13..28 0: (empty) - 1: GRAPHQL_NAME@13..20 - 0: GRAPHQL_NAME@13..20 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@13..20 + 0: IDENT@13..20 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@20..22 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@22..28 - 0: GRAPHQL_NAME@22..28 - 0: GRAPHQL_NAME@22..28 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@22..28 + 0: IDENT@22..28 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@28..28 1: GRAPHQL_FIELD_DEFINITION@28..39 0: (empty) - 1: GRAPHQL_NAME@28..34 - 0: GRAPHQL_NAME@28..34 "age" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@28..34 + 0: IDENT@28..34 "age" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@34..36 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@36..39 - 0: GRAPHQL_NAME@36..39 - 0: GRAPHQL_NAME@36..39 "Int" [] [] + 4: GRAPHQL_NAME_REFERENCE@36..39 + 0: IDENT@36..39 "Int" [] [] 5: GRAPHQL_DIRECTIVE_LIST@39..39 2: GRAPHQL_FIELD_DEFINITION@39..54 0: (empty) - 1: GRAPHQL_NAME@39..49 - 0: GRAPHQL_NAME@39..49 "picture" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@39..49 + 0: IDENT@39..49 "picture" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@49..51 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@51..54 - 0: GRAPHQL_NAME@51..54 - 0: GRAPHQL_NAME@51..54 "Url" [] [] + 4: GRAPHQL_NAME_REFERENCE@51..54 + 0: IDENT@51..54 "Url" [] [] 5: GRAPHQL_DIRECTIVE_LIST@54..54 2: R_CURLY@54..56 "}" [Newline("\n")] [] 1: GRAPHQL_OBJECT_TYPE_DEFINITION@56..100 0: (empty) 1: TYPE_KW@56..63 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@63..70 - 0: GRAPHQL_NAME@63..70 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@63..70 + 0: IDENT@63..70 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@70..82 0: GRAPHQL_DIRECTIVE@70..82 0: AT@70..71 "@" [] [] - 1: GRAPHQL_NAME@71..82 - 0: GRAPHQL_NAME@71..82 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@71..82 + 0: IDENT@71..82 "deprecated" [] [Whitespace(" ")] 2: (empty) 5: GRAPHQL_FIELDS_DEFINITION@82..100 0: L_CURLY@82..83 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@83..98 0: GRAPHQL_FIELD_DEFINITION@83..98 0: (empty) - 1: GRAPHQL_NAME@83..90 - 0: GRAPHQL_NAME@83..90 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@83..90 + 0: IDENT@83..90 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@90..92 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@92..98 - 0: GRAPHQL_NAME@92..98 - 0: GRAPHQL_NAME@92..98 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@92..98 + 0: IDENT@92..98 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@98..98 2: R_CURLY@98..100 "}" [Newline("\n")] [] 2: GRAPHQL_OBJECT_TYPE_DEFINITION@100..155 0: (empty) 1: TYPE_KW@100..107 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@107..114 - 0: GRAPHQL_NAME@107..114 "Animal" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@107..114 + 0: IDENT@107..114 "Animal" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@114..114 5: GRAPHQL_FIELDS_DEFINITION@114..155 @@ -807,167 +747,156 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@115..138 0: GRAPHQL_STRING_VALUE@115..138 0: GRAPHQL_STRING_LITERAL@115..138 "\"type of the animal\"" [Newline("\n"), Whitespace(" ")] [] - 1: GRAPHQL_NAME@138..145 - 0: GRAPHQL_NAME@138..145 "type" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@138..145 + 0: IDENT@138..145 "type" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@145..147 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@147..153 - 0: GRAPHQL_NAME@147..153 - 0: GRAPHQL_NAME@147..153 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@147..153 + 0: IDENT@147..153 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@153..153 2: R_CURLY@153..155 "}" [Newline("\n")] [] 3: GRAPHQL_OBJECT_TYPE_DEFINITION@155..220 0: (empty) 1: TYPE_KW@155..162 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@162..169 - 0: GRAPHQL_NAME@162..169 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@162..169 + 0: IDENT@162..169 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@169..190 0: IMPLEMENTS_KW@169..180 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@180..190 - 0: GRAPHQL_NAMED_TYPE@180..190 - 0: GRAPHQL_NAME@180..190 - 0: GRAPHQL_NAME@180..190 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@180..190 + 0: IDENT@180..190 "Character" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@190..202 0: GRAPHQL_DIRECTIVE@190..202 0: AT@190..191 "@" [] [] - 1: GRAPHQL_NAME@191..202 - 0: GRAPHQL_NAME@191..202 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@191..202 + 0: IDENT@191..202 "deprecated" [] [Whitespace(" ")] 2: (empty) 5: GRAPHQL_FIELDS_DEFINITION@202..220 0: L_CURLY@202..203 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@203..218 0: GRAPHQL_FIELD_DEFINITION@203..218 0: (empty) - 1: GRAPHQL_NAME@203..210 - 0: GRAPHQL_NAME@203..210 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@203..210 + 0: IDENT@203..210 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@210..212 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@212..218 - 0: GRAPHQL_NAME@212..218 - 0: GRAPHQL_NAME@212..218 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@212..218 + 0: IDENT@212..218 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@218..218 2: R_CURLY@218..220 "}" [Newline("\n")] [] 4: GRAPHQL_OBJECT_TYPE_DEFINITION@220..273 0: (empty) 1: TYPE_KW@220..227 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@227..234 - 0: GRAPHQL_NAME@227..234 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@227..234 + 0: IDENT@227..234 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@234..255 0: IMPLEMENTS_KW@234..245 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@245..255 - 0: GRAPHQL_NAMED_TYPE@245..255 - 0: GRAPHQL_NAME@245..255 - 0: GRAPHQL_NAME@245..255 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@245..255 + 0: IDENT@245..255 "Character" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@255..255 5: GRAPHQL_FIELDS_DEFINITION@255..273 0: L_CURLY@255..256 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@256..271 0: GRAPHQL_FIELD_DEFINITION@256..271 0: (empty) - 1: GRAPHQL_NAME@256..263 - 0: GRAPHQL_NAME@256..263 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@256..263 + 0: IDENT@256..263 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@263..265 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@265..271 - 0: GRAPHQL_NAME@265..271 - 0: GRAPHQL_NAME@265..271 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@265..271 + 0: IDENT@265..271 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@271..271 2: R_CURLY@271..273 "}" [Newline("\n")] [] 5: GRAPHQL_OBJECT_TYPE_DEFINITION@273..286 0: (empty) 1: TYPE_KW@273..280 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@280..286 - 0: GRAPHQL_NAME@280..286 "Person" [] [] + 2: GRAPHQL_NAME_BINDING@280..286 + 0: IDENT@280..286 "Person" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@286..286 5: (empty) 6: GRAPHQL_OBJECT_TYPE_DEFINITION@286..320 0: (empty) 1: TYPE_KW@286..293 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@293..300 - 0: GRAPHQL_NAME@293..300 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@293..300 + 0: IDENT@293..300 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@300..320 0: IMPLEMENTS_KW@300..311 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@311..320 - 0: GRAPHQL_NAMED_TYPE@311..320 - 0: GRAPHQL_NAME@311..320 - 0: GRAPHQL_NAME@311..320 "Character" [] [] + 0: GRAPHQL_NAME_REFERENCE@311..320 + 0: IDENT@311..320 "Character" [] [] 4: GRAPHQL_DIRECTIVE_LIST@320..320 5: (empty) 7: GRAPHQL_OBJECT_TYPE_DEFINITION@320..361 0: (empty) 1: TYPE_KW@320..327 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@327..334 - 0: GRAPHQL_NAME@327..334 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@327..334 + 0: IDENT@327..334 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@334..361 0: IMPLEMENTS_KW@334..345 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@345..361 - 0: GRAPHQL_NAMED_TYPE@345..355 - 0: GRAPHQL_NAME@345..355 - 0: GRAPHQL_NAME@345..355 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@345..355 + 0: IDENT@345..355 "Character" [] [Whitespace(" ")] 1: AMP@355..357 "&" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@357..361 - 0: GRAPHQL_NAME@357..361 - 0: GRAPHQL_NAME@357..361 "type" [] [] + 2: GRAPHQL_NAME_REFERENCE@357..361 + 0: IDENT@357..361 "type" [] [] 4: GRAPHQL_DIRECTIVE_LIST@361..361 5: (empty) 8: GRAPHQL_OBJECT_TYPE_DEFINITION@361..386 0: (empty) 1: TYPE_KW@361..368 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@368..375 - 0: GRAPHQL_NAME@368..375 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@368..375 + 0: IDENT@368..375 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@375..386 0: GRAPHQL_DIRECTIVE@375..386 0: AT@375..376 "@" [] [] - 1: GRAPHQL_NAME@376..386 - 0: GRAPHQL_NAME@376..386 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@376..386 + 0: IDENT@376..386 "deprecated" [] [] 2: (empty) 5: (empty) 9: GRAPHQL_OBJECT_TYPE_DEFINITION@386..432 0: (empty) 1: TYPE_KW@386..393 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@393..400 - 0: GRAPHQL_NAME@393..400 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@393..400 + 0: IDENT@393..400 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@400..421 0: IMPLEMENTS_KW@400..411 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@411..421 - 0: GRAPHQL_NAMED_TYPE@411..421 - 0: GRAPHQL_NAME@411..421 - 0: GRAPHQL_NAME@411..421 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@411..421 + 0: IDENT@411..421 "Character" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@421..432 0: GRAPHQL_DIRECTIVE@421..432 0: AT@421..422 "@" [] [] - 1: GRAPHQL_NAME@422..432 - 0: GRAPHQL_NAME@422..432 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@422..432 + 0: IDENT@422..432 "deprecated" [] [] 2: (empty) 5: (empty) 10: GRAPHQL_OBJECT_TYPE_DEFINITION@432..491 0: (empty) 1: TYPE_KW@432..439 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@439..446 - 0: GRAPHQL_NAME@439..446 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@439..446 + 0: IDENT@439..446 "Person" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@446..480 0: IMPLEMENTS_KW@446..457 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@457..480 - 0: GRAPHQL_NAMED_TYPE@457..467 - 0: GRAPHQL_NAME@457..467 - 0: GRAPHQL_NAME@457..467 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@457..467 + 0: IDENT@457..467 "Character" [] [Whitespace(" ")] 1: AMP@467..469 "&" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@469..480 - 0: GRAPHQL_NAME@469..480 - 0: GRAPHQL_NAME@469..480 "Character1" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@469..480 + 0: IDENT@469..480 "Character1" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@480..491 0: GRAPHQL_DIRECTIVE@480..491 0: AT@480..481 "@" [] [] - 1: GRAPHQL_NAME@481..491 - 0: GRAPHQL_NAME@481..491 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@481..491 + 0: IDENT@481..491 "deprecated" [] [] 2: (empty) 5: (empty) 11: GRAPHQL_OBJECT_TYPE_DEFINITION@491..850 @@ -975,8 +904,8 @@ GraphqlRoot { 0: GRAPHQL_STRING_VALUE@491..511 0: GRAPHQL_STRING_LITERAL@491..511 "\"This is a person\"" [Newline("\n"), Newline("\n")] [] 1: TYPE_KW@511..517 "type" [Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@517..524 - 0: GRAPHQL_NAME@517..524 "Person" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@517..524 + 0: IDENT@517..524 "Person" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@524..524 5: GRAPHQL_FIELDS_DEFINITION@524..850 @@ -984,59 +913,55 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@525..848 0: GRAPHQL_FIELD_DEFINITION@525..560 0: (empty) - 1: GRAPHQL_NAME@525..532 - 0: GRAPHQL_NAME@525..532 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@525..532 + 0: IDENT@525..532 "name" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@532..552 0: L_PAREN@532..533 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@533..551 0: GRAPHQL_INPUT_VALUE_DEFINITION@533..551 0: (empty) - 1: GRAPHQL_NAME@533..543 - 0: GRAPHQL_NAME@533..543 "start_with" [] [] + 1: GRAPHQL_LITERAL_NAME@533..543 + 0: IDENT@533..543 "start_with" [] [] 2: COLON@543..545 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@545..551 - 0: GRAPHQL_NAME@545..551 - 0: GRAPHQL_NAME@545..551 "String" [] [] + 3: GRAPHQL_NAME_REFERENCE@545..551 + 0: IDENT@545..551 "String" [] [] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@551..551 2: R_PAREN@551..552 ")" [] [] 3: COLON@552..554 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@554..560 - 0: GRAPHQL_NAME@554..560 - 0: GRAPHQL_NAME@554..560 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@554..560 + 0: IDENT@554..560 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@560..560 1: GRAPHQL_FIELD_DEFINITION@560..599 0: GRAPHQL_DESCRIPTION@560..579 0: GRAPHQL_STRING_VALUE@560..579 0: GRAPHQL_STRING_LITERAL@560..579 "\"filder by age\"" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] - 1: GRAPHQL_NAME@579..582 - 0: GRAPHQL_NAME@579..582 "age" [] [] + 1: GRAPHQL_LITERAL_NAME@579..582 + 0: IDENT@579..582 "age" [] [] 2: (empty) 3: COLON@582..584 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@584..588 - 0: GRAPHQL_NAME@584..588 - 0: GRAPHQL_NAME@584..588 "Int" [] [Whitespace(" ")] + 4: GRAPHQL_NAME_REFERENCE@584..588 + 0: IDENT@584..588 "Int" [] [Whitespace(" ")] 5: GRAPHQL_DIRECTIVE_LIST@588..599 0: GRAPHQL_DIRECTIVE@588..599 0: AT@588..589 "@" [] [] - 1: GRAPHQL_NAME@589..599 - 0: GRAPHQL_NAME@589..599 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@589..599 + 0: IDENT@589..599 "deprecated" [] [] 2: (empty) 2: GRAPHQL_FIELD_DEFINITION@599..629 0: (empty) - 1: GRAPHQL_NAME@599..609 - 0: GRAPHQL_NAME@599..609 "picture" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@599..609 + 0: IDENT@599..609 "picture" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@609..624 0: L_PAREN@609..610 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@610..623 0: GRAPHQL_INPUT_VALUE_DEFINITION@610..623 0: (empty) - 1: GRAPHQL_NAME@610..614 - 0: GRAPHQL_NAME@610..614 "size" [] [] + 1: GRAPHQL_LITERAL_NAME@610..614 + 0: IDENT@610..614 "size" [] [] 2: COLON@614..616 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@616..620 - 0: GRAPHQL_NAME@616..620 - 0: GRAPHQL_NAME@616..620 "Int" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@616..620 + 0: IDENT@616..620 "Int" [] [Whitespace(" ")] 4: GRAPHQL_DEFAULT_VALUE@620..623 0: EQ@620..622 "=" [] [Whitespace(" ")] 1: GRAPHQL_INT_VALUE@622..623 @@ -1044,14 +969,13 @@ GraphqlRoot { 5: GRAPHQL_DIRECTIVE_LIST@623..623 2: R_PAREN@623..624 ")" [] [] 3: COLON@624..626 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@626..629 - 0: GRAPHQL_NAME@626..629 - 0: GRAPHQL_NAME@626..629 "Url" [] [] + 4: GRAPHQL_NAME_REFERENCE@626..629 + 0: IDENT@626..629 "Url" [] [] 5: GRAPHQL_DIRECTIVE_LIST@629..629 3: GRAPHQL_FIELD_DEFINITION@629..693 0: (empty) - 1: GRAPHQL_NAME@629..638 - 0: GRAPHQL_NAME@629..638 "height" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@629..638 + 0: IDENT@629..638 "height" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@638..688 0: L_PAREN@638..639 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@639..687 @@ -1059,29 +983,27 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@639..658 0: GRAPHQL_STRING_VALUE@639..658 0: GRAPHQL_STRING_LITERAL@639..658 "\"filter by height\"" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@658..670 - 0: GRAPHQL_NAME@658..670 "greater_than" [] [] + 1: GRAPHQL_LITERAL_NAME@658..670 + 0: IDENT@658..670 "greater_than" [] [] 2: COLON@670..672 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@672..676 - 0: GRAPHQL_NAME@672..676 - 0: GRAPHQL_NAME@672..676 "Int" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@672..676 + 0: IDENT@672..676 "Int" [] [Whitespace(" ")] 4: (empty) 5: GRAPHQL_DIRECTIVE_LIST@676..687 0: GRAPHQL_DIRECTIVE@676..687 0: AT@676..677 "@" [] [] - 1: GRAPHQL_NAME@677..687 - 0: GRAPHQL_NAME@677..687 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@677..687 + 0: IDENT@677..687 "deprecated" [] [] 2: (empty) 2: R_PAREN@687..688 ")" [] [] 3: COLON@688..690 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@690..693 - 0: GRAPHQL_NAME@690..693 - 0: GRAPHQL_NAME@690..693 "Int" [] [] + 4: GRAPHQL_NAME_REFERENCE@690..693 + 0: IDENT@690..693 "Int" [] [] 5: GRAPHQL_DIRECTIVE_LIST@693..693 4: GRAPHQL_FIELD_DEFINITION@693..761 0: (empty) - 1: GRAPHQL_NAME@693..702 - 0: GRAPHQL_NAME@693..702 "weight" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@693..702 + 0: IDENT@693..702 "weight" [Newline("\n"), Whitespace(" ")] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@702..756 0: L_PAREN@702..703 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@703..755 @@ -1089,12 +1011,11 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@703..722 0: GRAPHQL_STRING_VALUE@703..722 0: GRAPHQL_STRING_LITERAL@703..722 "\"filter by weight\"" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@722..734 - 0: GRAPHQL_NAME@722..734 "greater_than" [] [] + 1: GRAPHQL_LITERAL_NAME@722..734 + 0: IDENT@722..734 "greater_than" [] [] 2: COLON@734..736 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@736..740 - 0: GRAPHQL_NAME@736..740 - 0: GRAPHQL_NAME@736..740 "Int" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@736..740 + 0: IDENT@736..740 "Int" [] [Whitespace(" ")] 4: GRAPHQL_DEFAULT_VALUE@740..744 0: EQ@740..742 "=" [] [Whitespace(" ")] 1: GRAPHQL_INT_VALUE@742..744 @@ -1102,21 +1023,20 @@ GraphqlRoot { 5: GRAPHQL_DIRECTIVE_LIST@744..755 0: GRAPHQL_DIRECTIVE@744..755 0: AT@744..745 "@" [] [] - 1: GRAPHQL_NAME@745..755 - 0: GRAPHQL_NAME@745..755 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@745..755 + 0: IDENT@745..755 "deprecated" [] [] 2: (empty) 2: R_PAREN@755..756 ")" [] [] 3: COLON@756..758 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@758..761 - 0: GRAPHQL_NAME@758..761 - 0: GRAPHQL_NAME@758..761 "Int" [] [] + 4: GRAPHQL_NAME_REFERENCE@758..761 + 0: IDENT@758..761 "Int" [] [] 5: GRAPHQL_DIRECTIVE_LIST@761..761 5: GRAPHQL_FIELD_DEFINITION@761..848 0: GRAPHQL_DESCRIPTION@761..783 0: GRAPHQL_STRING_VALUE@761..783 0: GRAPHQL_STRING_LITERAL@761..783 "\"filter by weight\"" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] - 1: GRAPHQL_NAME@783..789 - 0: GRAPHQL_NAME@783..789 "weight" [] [] + 1: GRAPHQL_LITERAL_NAME@783..789 + 0: IDENT@783..789 "weight" [] [] 2: GRAPHQL_ARGUMENTS_DEFINITION@789..843 0: L_PAREN@789..790 "(" [] [] 1: GRAPHQL_ARGUMENT_DEFINITION_LIST@790..842 @@ -1124,12 +1044,11 @@ GraphqlRoot { 0: GRAPHQL_DESCRIPTION@790..809 0: GRAPHQL_STRING_VALUE@790..809 0: GRAPHQL_STRING_LITERAL@790..809 "\"filter by weight\"" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@809..821 - 0: GRAPHQL_NAME@809..821 "greater_than" [] [] + 1: GRAPHQL_LITERAL_NAME@809..821 + 0: IDENT@809..821 "greater_than" [] [] 2: COLON@821..823 ":" [] [Whitespace(" ")] - 3: GRAPHQL_NAMED_TYPE@823..827 - 0: GRAPHQL_NAME@823..827 - 0: GRAPHQL_NAME@823..827 "Int" [] [Whitespace(" ")] + 3: GRAPHQL_NAME_REFERENCE@823..827 + 0: IDENT@823..827 "Int" [] [Whitespace(" ")] 4: GRAPHQL_DEFAULT_VALUE@827..831 0: EQ@827..829 "=" [] [Whitespace(" ")] 1: GRAPHQL_INT_VALUE@829..831 @@ -1137,41 +1056,38 @@ GraphqlRoot { 5: GRAPHQL_DIRECTIVE_LIST@831..842 0: GRAPHQL_DIRECTIVE@831..842 0: AT@831..832 "@" [] [] - 1: GRAPHQL_NAME@832..842 - 0: GRAPHQL_NAME@832..842 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@832..842 + 0: IDENT@832..842 "deprecated" [] [] 2: (empty) 2: R_PAREN@842..843 ")" [] [] 3: COLON@843..845 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@845..848 - 0: GRAPHQL_NAME@845..848 - 0: GRAPHQL_NAME@845..848 "Int" [] [] + 4: GRAPHQL_NAME_REFERENCE@845..848 + 0: IDENT@845..848 "Int" [] [] 5: GRAPHQL_DIRECTIVE_LIST@848..848 2: R_CURLY@848..850 "}" [Newline("\n")] [] 12: GRAPHQL_OBJECT_TYPE_DEFINITION@850..894 0: (empty) 1: TYPE_KW@850..857 "type" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@857..862 - 0: GRAPHQL_NAME@857..862 "type" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@857..862 + 0: IDENT@857..862 "type" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@862..878 0: IMPLEMENTS_KW@862..873 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@873..878 - 0: GRAPHQL_NAMED_TYPE@873..878 - 0: GRAPHQL_NAME@873..878 - 0: GRAPHQL_NAME@873..878 "type" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@873..878 + 0: IDENT@873..878 "type" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@878..878 5: GRAPHQL_FIELDS_DEFINITION@878..894 0: L_CURLY@878..879 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@879..892 0: GRAPHQL_FIELD_DEFINITION@879..892 0: (empty) - 1: GRAPHQL_NAME@879..886 - 0: GRAPHQL_NAME@879..886 "type" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@879..886 + 0: IDENT@879..886 "type" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@886..888 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@888..892 - 0: GRAPHQL_NAME@888..892 - 0: GRAPHQL_NAME@888..892 "type" [] [] + 4: GRAPHQL_NAME_REFERENCE@888..892 + 0: IDENT@888..892 "type" [] [] 5: GRAPHQL_DIRECTIVE_LIST@892..892 2: R_CURLY@892..894 "}" [Newline("\n")] [] 2: EOF@894..896 "" [Newline("\n"), Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/object_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/object_extension.graphql.snap index c911b98f85a3..f646af50fac1 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/object_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/object_extension.graphql.snap @@ -33,8 +33,8 @@ GraphqlRoot { GraphqlObjectTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], type_token: TYPE_KW@7..12 "type" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@12..18 "Story" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@12..18 "Story" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [], @@ -43,15 +43,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@19..37 "isHiddenLocally" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@19..37 "isHiddenLocally" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@37..39 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@39..46 "Boolean" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@39..46 "Boolean" [] [], }, directives: GraphqlDirectiveList [], }, @@ -62,15 +60,15 @@ GraphqlRoot { GraphqlObjectTypeExtension { extend_token: EXTEND_KW@48..57 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], type_token: TYPE_KW@57..62 "type" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@62..67 "User" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@62..67 "User" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@67..68 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@68..82 "addedDirective" [] [], + name: GraphqlNameReference { + value_token: IDENT@68..82 "addedDirective" [] [], }, arguments: missing (optional), }, @@ -80,17 +78,15 @@ GraphqlRoot { GraphqlObjectTypeExtension { extend_token: EXTEND_KW@82..91 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], type_token: TYPE_KW@91..96 "type" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@96..101 "User" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@96..101 "User" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@101..112 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@112..121 "Character" [] [], - }, + GraphqlNameReference { + value_token: IDENT@112..121 "Character" [] [], }, ], }, @@ -100,25 +96,23 @@ GraphqlRoot { GraphqlObjectTypeExtension { extend_token: EXTEND_KW@121..130 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], type_token: TYPE_KW@130..135 "type" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@135..140 "User" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@135..140 "User" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@140..151 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@151..161 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@151..161 "Character" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@161..162 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@162..172 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@162..172 "deprecated" [] [], }, arguments: missing (optional), }, @@ -128,15 +122,15 @@ GraphqlRoot { GraphqlObjectTypeExtension { extend_token: EXTEND_KW@172..181 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], type_token: TYPE_KW@181..186 "type" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@186..191 "User" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@186..191 "User" [] [Whitespace(" ")], }, implements: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@191..192 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@192..203 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@192..203 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -146,15 +140,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@204..211 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@204..211 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@211..213 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@213..219 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@213..219 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -165,25 +157,23 @@ GraphqlRoot { GraphqlObjectTypeExtension { extend_token: EXTEND_KW@221..230 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], type_token: TYPE_KW@230..235 "type" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@235..240 "User" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@235..240 "User" [] [Whitespace(" ")], }, implements: GraphqlImplementsInterfaces { implements_token: IMPLEMENTS_KW@240..251 "implements" [] [Whitespace(" ")], amp_token: missing (optional), interfaces: GraphqlImplementsInterfaceList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@251..261 "Character" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@251..261 "Character" [] [Whitespace(" ")], }, ], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@261..262 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@262..273 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@262..273 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -193,15 +183,13 @@ GraphqlRoot { fields: GraphqlFieldDefinitionList [ GraphqlFieldDefinition { description: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@274..281 "name" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@274..281 "name" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), colon_token: COLON@281..283 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@283..289 "String" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@283..289 "String" [] [], }, directives: GraphqlDirectiveList [], }, @@ -223,8 +211,8 @@ GraphqlRoot { 0: GRAPHQL_OBJECT_TYPE_EXTENSION@0..48 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: TYPE_KW@7..12 "type" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@12..18 - 0: GRAPHQL_NAME@12..18 "Story" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@12..18 + 0: IDENT@12..18 "Story" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@18..18 5: GRAPHQL_FIELDS_DEFINITION@18..48 @@ -232,117 +220,111 @@ GraphqlRoot { 1: GRAPHQL_FIELD_DEFINITION_LIST@19..46 0: GRAPHQL_FIELD_DEFINITION@19..46 0: (empty) - 1: GRAPHQL_NAME@19..37 - 0: GRAPHQL_NAME@19..37 "isHiddenLocally" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@19..37 + 0: IDENT@19..37 "isHiddenLocally" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@37..39 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@39..46 - 0: GRAPHQL_NAME@39..46 - 0: GRAPHQL_NAME@39..46 "Boolean" [] [] + 4: GRAPHQL_NAME_REFERENCE@39..46 + 0: IDENT@39..46 "Boolean" [] [] 5: GRAPHQL_DIRECTIVE_LIST@46..46 2: R_CURLY@46..48 "}" [Newline("\n")] [] 1: GRAPHQL_OBJECT_TYPE_EXTENSION@48..82 0: EXTEND_KW@48..57 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: TYPE_KW@57..62 "type" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@62..67 - 0: GRAPHQL_NAME@62..67 "User" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@62..67 + 0: IDENT@62..67 "User" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@67..82 0: GRAPHQL_DIRECTIVE@67..82 0: AT@67..68 "@" [] [] - 1: GRAPHQL_NAME@68..82 - 0: GRAPHQL_NAME@68..82 "addedDirective" [] [] + 1: GRAPHQL_NAME_REFERENCE@68..82 + 0: IDENT@68..82 "addedDirective" [] [] 2: (empty) 5: (empty) 2: GRAPHQL_OBJECT_TYPE_EXTENSION@82..121 0: EXTEND_KW@82..91 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: TYPE_KW@91..96 "type" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@96..101 - 0: GRAPHQL_NAME@96..101 "User" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@96..101 + 0: IDENT@96..101 "User" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@101..121 0: IMPLEMENTS_KW@101..112 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@112..121 - 0: GRAPHQL_NAMED_TYPE@112..121 - 0: GRAPHQL_NAME@112..121 - 0: GRAPHQL_NAME@112..121 "Character" [] [] + 0: GRAPHQL_NAME_REFERENCE@112..121 + 0: IDENT@112..121 "Character" [] [] 4: GRAPHQL_DIRECTIVE_LIST@121..121 5: (empty) 3: GRAPHQL_OBJECT_TYPE_EXTENSION@121..172 0: EXTEND_KW@121..130 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: TYPE_KW@130..135 "type" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@135..140 - 0: GRAPHQL_NAME@135..140 "User" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@135..140 + 0: IDENT@135..140 "User" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@140..161 0: IMPLEMENTS_KW@140..151 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@151..161 - 0: GRAPHQL_NAMED_TYPE@151..161 - 0: GRAPHQL_NAME@151..161 - 0: GRAPHQL_NAME@151..161 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@151..161 + 0: IDENT@151..161 "Character" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@161..172 0: GRAPHQL_DIRECTIVE@161..172 0: AT@161..162 "@" [] [] - 1: GRAPHQL_NAME@162..172 - 0: GRAPHQL_NAME@162..172 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@162..172 + 0: IDENT@162..172 "deprecated" [] [] 2: (empty) 5: (empty) 4: GRAPHQL_OBJECT_TYPE_EXTENSION@172..221 0: EXTEND_KW@172..181 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: TYPE_KW@181..186 "type" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@186..191 - 0: GRAPHQL_NAME@186..191 "User" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@186..191 + 0: IDENT@186..191 "User" [] [Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@191..203 0: GRAPHQL_DIRECTIVE@191..203 0: AT@191..192 "@" [] [] - 1: GRAPHQL_NAME@192..203 - 0: GRAPHQL_NAME@192..203 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@192..203 + 0: IDENT@192..203 "deprecated" [] [Whitespace(" ")] 2: (empty) 5: GRAPHQL_FIELDS_DEFINITION@203..221 0: L_CURLY@203..204 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@204..219 0: GRAPHQL_FIELD_DEFINITION@204..219 0: (empty) - 1: GRAPHQL_NAME@204..211 - 0: GRAPHQL_NAME@204..211 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@204..211 + 0: IDENT@204..211 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@211..213 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@213..219 - 0: GRAPHQL_NAME@213..219 - 0: GRAPHQL_NAME@213..219 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@213..219 + 0: IDENT@213..219 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@219..219 2: R_CURLY@219..221 "}" [Newline("\n")] [] 5: GRAPHQL_OBJECT_TYPE_EXTENSION@221..291 0: EXTEND_KW@221..230 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: TYPE_KW@230..235 "type" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@235..240 - 0: GRAPHQL_NAME@235..240 "User" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@235..240 + 0: IDENT@235..240 "User" [] [Whitespace(" ")] 3: GRAPHQL_IMPLEMENTS_INTERFACES@240..261 0: IMPLEMENTS_KW@240..251 "implements" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_IMPLEMENTS_INTERFACE_LIST@251..261 - 0: GRAPHQL_NAMED_TYPE@251..261 - 0: GRAPHQL_NAME@251..261 - 0: GRAPHQL_NAME@251..261 "Character" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@251..261 + 0: IDENT@251..261 "Character" [] [Whitespace(" ")] 4: GRAPHQL_DIRECTIVE_LIST@261..273 0: GRAPHQL_DIRECTIVE@261..273 0: AT@261..262 "@" [] [] - 1: GRAPHQL_NAME@262..273 - 0: GRAPHQL_NAME@262..273 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@262..273 + 0: IDENT@262..273 "deprecated" [] [Whitespace(" ")] 2: (empty) 5: GRAPHQL_FIELDS_DEFINITION@273..291 0: L_CURLY@273..274 "{" [] [] 1: GRAPHQL_FIELD_DEFINITION_LIST@274..289 0: GRAPHQL_FIELD_DEFINITION@274..289 0: (empty) - 1: GRAPHQL_NAME@274..281 - 0: GRAPHQL_NAME@274..281 "name" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@274..281 + 0: IDENT@274..281 "name" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: COLON@281..283 ":" [] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@283..289 - 0: GRAPHQL_NAME@283..289 - 0: GRAPHQL_NAME@283..289 "String" [] [] + 4: GRAPHQL_NAME_REFERENCE@283..289 + 0: IDENT@283..289 "String" [] [] 5: GRAPHQL_DIRECTIVE_LIST@289..289 2: R_CURLY@289..291 "}" [Newline("\n")] [] 2: EOF@291..292 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/scalar.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/scalar.graphql.snap index fb020e906be0..ea49bb0c1ff0 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/scalar.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/scalar.graphql.snap @@ -20,21 +20,21 @@ GraphqlRoot { GraphqlScalarTypeDefinition { description: missing (optional), scalar_token: SCALAR_KW@0..7 "scalar" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@7..12 "UUID" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@7..12 "UUID" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@12..13 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@13..24 "specifiedBy" [] [], + name: GraphqlNameReference { + value_token: IDENT@13..24 "specifiedBy" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@24..25 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@25..28 "url" [] [], + name: GraphqlLiteralName { + value_token: IDENT@25..28 "url" [] [], }, colon_token: COLON@28..30 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -54,21 +54,21 @@ GraphqlRoot { }, }, scalar_token: SCALAR_KW@75..82 "scalar" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@82..86 "URL" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@82..86 "URL" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@86..87 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@87..98 "specifiedBy" [] [], + name: GraphqlNameReference { + value_token: IDENT@87..98 "specifiedBy" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@98..99 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@99..102 "url" [] [], + name: GraphqlLiteralName { + value_token: IDENT@99..102 "url" [] [], }, colon_token: COLON@102..104 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -84,26 +84,26 @@ GraphqlRoot { GraphqlScalarTypeDefinition { description: missing (optional), scalar_token: SCALAR_KW@142..151 "scalar" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@151..158 "scalar" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@151..158 "scalar" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@158..159 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@159..165 "scalar" [] [], + name: GraphqlNameReference { + value_token: IDENT@159..165 "scalar" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@165..166 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@166..172 "scalar" [] [], + name: GraphqlLiteralName { + value_token: IDENT@166..172 "scalar" [] [], }, colon_token: COLON@172..174 ":" [] [Whitespace(" ")], value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@174..180 "scalar" [] [], + value: GraphqlLiteralName { + value_token: IDENT@174..180 "scalar" [] [], }, }, }, @@ -127,19 +127,19 @@ GraphqlRoot { 0: GRAPHQL_SCALAR_TYPE_DEFINITION@0..68 0: (empty) 1: SCALAR_KW@0..7 "scalar" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@7..12 - 0: GRAPHQL_NAME@7..12 "UUID" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@7..12 + 0: IDENT@7..12 "UUID" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@12..68 0: GRAPHQL_DIRECTIVE@12..68 0: AT@12..13 "@" [] [] - 1: GRAPHQL_NAME@13..24 - 0: GRAPHQL_NAME@13..24 "specifiedBy" [] [] + 1: GRAPHQL_NAME_REFERENCE@13..24 + 0: IDENT@13..24 "specifiedBy" [] [] 2: GRAPHQL_ARGUMENTS@24..68 0: L_PAREN@24..25 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@25..67 0: GRAPHQL_ARGUMENT@25..67 - 0: GRAPHQL_NAME@25..28 - 0: GRAPHQL_NAME@25..28 "url" [] [] + 0: GRAPHQL_LITERAL_NAME@25..28 + 0: IDENT@25..28 "url" [] [] 1: COLON@28..30 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@30..67 0: GRAPHQL_STRING_LITERAL@30..67 "\"https://tools.ietf.org/html/rfc4122\"" [] [] @@ -149,19 +149,19 @@ GraphqlRoot { 0: GRAPHQL_STRING_VALUE@68..75 0: GRAPHQL_STRING_LITERAL@68..75 "\"abc\"" [Newline("\n")] [Whitespace(" ")] 1: SCALAR_KW@75..82 "scalar" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@82..86 - 0: GRAPHQL_NAME@82..86 "URL" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@82..86 + 0: IDENT@82..86 "URL" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@86..142 0: GRAPHQL_DIRECTIVE@86..142 0: AT@86..87 "@" [] [] - 1: GRAPHQL_NAME@87..98 - 0: GRAPHQL_NAME@87..98 "specifiedBy" [] [] + 1: GRAPHQL_NAME_REFERENCE@87..98 + 0: IDENT@87..98 "specifiedBy" [] [] 2: GRAPHQL_ARGUMENTS@98..142 0: L_PAREN@98..99 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@99..141 0: GRAPHQL_ARGUMENT@99..141 - 0: GRAPHQL_NAME@99..102 - 0: GRAPHQL_NAME@99..102 "url" [] [] + 0: GRAPHQL_LITERAL_NAME@99..102 + 0: IDENT@99..102 "url" [] [] 1: COLON@102..104 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@104..141 0: GRAPHQL_STRING_LITERAL@104..141 "\"https://tools.ietf.org/html/rfc3986\"" [] [] @@ -169,23 +169,23 @@ GraphqlRoot { 2: GRAPHQL_SCALAR_TYPE_DEFINITION@142..181 0: (empty) 1: SCALAR_KW@142..151 "scalar" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@151..158 - 0: GRAPHQL_NAME@151..158 "scalar" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@151..158 + 0: IDENT@151..158 "scalar" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@158..181 0: GRAPHQL_DIRECTIVE@158..181 0: AT@158..159 "@" [] [] - 1: GRAPHQL_NAME@159..165 - 0: GRAPHQL_NAME@159..165 "scalar" [] [] + 1: GRAPHQL_NAME_REFERENCE@159..165 + 0: IDENT@159..165 "scalar" [] [] 2: GRAPHQL_ARGUMENTS@165..181 0: L_PAREN@165..166 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@166..180 0: GRAPHQL_ARGUMENT@166..180 - 0: GRAPHQL_NAME@166..172 - 0: GRAPHQL_NAME@166..172 "scalar" [] [] + 0: GRAPHQL_LITERAL_NAME@166..172 + 0: IDENT@166..172 "scalar" [] [] 1: COLON@172..174 ":" [] [Whitespace(" ")] 2: GRAPHQL_ENUM_VALUE@174..180 - 0: GRAPHQL_NAME@174..180 - 0: GRAPHQL_NAME@174..180 "scalar" [] [] + 0: GRAPHQL_LITERAL_NAME@174..180 + 0: IDENT@174..180 "scalar" [] [] 2: R_PAREN@180..181 ")" [] [] 2: EOF@181..182 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/scalar_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/scalar_extension.graphql.snap index 70b410e7b48e..38c0b7f4ba50 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/scalar_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/scalar_extension.graphql.snap @@ -17,14 +17,14 @@ GraphqlRoot { GraphqlScalarTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], scalar_token: SCALAR_KW@7..14 "scalar" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@14..19 "Date" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@14..19 "Date" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@19..20 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@20..36 "scalar_extension" [] [], + name: GraphqlNameReference { + value_token: IDENT@20..36 "scalar_extension" [] [], }, arguments: missing (optional), }, @@ -44,13 +44,13 @@ GraphqlRoot { 0: GRAPHQL_SCALAR_TYPE_EXTENSION@0..36 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: SCALAR_KW@7..14 "scalar" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@14..19 - 0: GRAPHQL_NAME@14..19 "Date" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@14..19 + 0: IDENT@14..19 "Date" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@19..36 0: GRAPHQL_DIRECTIVE@19..36 0: AT@19..20 "@" [] [] - 1: GRAPHQL_NAME@20..36 - 0: GRAPHQL_NAME@20..36 "scalar_extension" [] [] + 1: GRAPHQL_NAME_REFERENCE@20..36 + 0: IDENT@20..36 "scalar_extension" [] [] 2: (empty) 2: EOF@36..37 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/schema.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/schema.graphql.snap index 7c83d072ad45..9e4bb28dbbe7 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/schema.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/schema.graphql.snap @@ -46,10 +46,8 @@ GraphqlRoot { value_token: QUERY_KW@8..16 "query" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@16..18 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@18..33 "MyQueryRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@18..33 "MyQueryRootType" [] [], }, }, GraphqlRootOperationTypeDefinition { @@ -57,10 +55,8 @@ GraphqlRoot { value_token: MUTATION_KW@33..44 "mutation" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@44..46 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@46..64 "MyMutationRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@46..64 "MyMutationRootType" [] [], }, }, GraphqlRootOperationTypeDefinition { @@ -68,10 +64,8 @@ GraphqlRoot { value_token: SUBSCRIPTION_KW@64..78 "subscription" [Newline("\n"), Whitespace("\t")] [], }, colon_token: COLON@78..80 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@80..102 "MySubscriptionRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@80..102 "MySubscriptionRootType" [] [], }, }, ], @@ -94,10 +88,8 @@ GraphqlRoot { value_token: QUERY_KW@121..129 "query" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@129..131 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@131..146 "MyQueryRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@131..146 "MyQueryRootType" [] [], }, }, GraphqlRootOperationTypeDefinition { @@ -105,10 +97,8 @@ GraphqlRoot { value_token: MUTATION_KW@146..157 "mutation" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@157..159 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@159..177 "MyMutationRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@159..177 "MyMutationRootType" [] [], }, }, ], @@ -131,10 +121,8 @@ GraphqlRoot { value_token: QUERY_KW@199..207 "query" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@207..209 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@209..224 "MyQueryRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@209..224 "MyQueryRootType" [] [], }, }, ], @@ -153,10 +141,8 @@ GraphqlRoot { value_token: QUERY_KW@236..244 "query" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@244..246 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@246..251 "query" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@246..251 "query" [] [], }, }, GraphqlRootOperationTypeDefinition { @@ -164,10 +150,8 @@ GraphqlRoot { value_token: MUTATION_KW@251..262 "mutation" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@262..264 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@264..272 "mutation" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@264..272 "mutation" [] [], }, }, GraphqlRootOperationTypeDefinition { @@ -175,10 +159,8 @@ GraphqlRoot { value_token: SUBSCRIPTION_KW@272..286 "subscription" [Newline("\n"), Whitespace("\t")] [], }, colon_token: COLON@286..288 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@288..300 "subscription" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@288..300 "subscription" [] [], }, }, ], @@ -207,23 +189,20 @@ GraphqlRoot { 0: GRAPHQL_OPERATION_TYPE@8..16 0: QUERY_KW@8..16 "query" [Newline("\n"), Whitespace(" ")] [] 1: COLON@16..18 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@18..33 - 0: GRAPHQL_NAME@18..33 - 0: GRAPHQL_NAME@18..33 "MyQueryRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@18..33 + 0: IDENT@18..33 "MyQueryRootType" [] [] 1: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@33..64 0: GRAPHQL_OPERATION_TYPE@33..44 0: MUTATION_KW@33..44 "mutation" [Newline("\n"), Whitespace(" ")] [] 1: COLON@44..46 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@46..64 - 0: GRAPHQL_NAME@46..64 - 0: GRAPHQL_NAME@46..64 "MyMutationRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@46..64 + 0: IDENT@46..64 "MyMutationRootType" [] [] 2: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@64..102 0: GRAPHQL_OPERATION_TYPE@64..78 0: SUBSCRIPTION_KW@64..78 "subscription" [Newline("\n"), Whitespace("\t")] [] 1: COLON@78..80 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@80..102 - 0: GRAPHQL_NAME@80..102 - 0: GRAPHQL_NAME@80..102 "MySubscriptionRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@80..102 + 0: IDENT@80..102 "MySubscriptionRootType" [] [] 2: R_CURLY@102..104 "}" [Newline("\n")] [] 1: GRAPHQL_SCHEMA_DEFINITION@104..179 0: GRAPHQL_DESCRIPTION@104..113 @@ -238,16 +217,14 @@ GraphqlRoot { 0: GRAPHQL_OPERATION_TYPE@121..129 0: QUERY_KW@121..129 "query" [Newline("\n"), Whitespace(" ")] [] 1: COLON@129..131 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@131..146 - 0: GRAPHQL_NAME@131..146 - 0: GRAPHQL_NAME@131..146 "MyQueryRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@131..146 + 0: IDENT@131..146 "MyQueryRootType" [] [] 1: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@146..177 0: GRAPHQL_OPERATION_TYPE@146..157 0: MUTATION_KW@146..157 "mutation" [Newline("\n"), Whitespace(" ")] [] 1: COLON@157..159 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@159..177 - 0: GRAPHQL_NAME@159..177 - 0: GRAPHQL_NAME@159..177 "MyMutationRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@159..177 + 0: IDENT@159..177 "MyMutationRootType" [] [] 2: R_CURLY@177..179 "}" [Newline("\n")] [] 2: GRAPHQL_SCHEMA_DEFINITION@179..226 0: GRAPHQL_DESCRIPTION@179..190 @@ -262,9 +239,8 @@ GraphqlRoot { 0: GRAPHQL_OPERATION_TYPE@199..207 0: QUERY_KW@199..207 "query" [Newline("\n"), Whitespace(" ")] [] 1: COLON@207..209 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@209..224 - 0: GRAPHQL_NAME@209..224 - 0: GRAPHQL_NAME@209..224 "MyQueryRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@209..224 + 0: IDENT@209..224 "MyQueryRootType" [] [] 2: R_CURLY@224..226 "}" [Newline("\n")] [] 3: GRAPHQL_SCHEMA_DEFINITION@226..302 0: (empty) @@ -277,23 +253,20 @@ GraphqlRoot { 0: GRAPHQL_OPERATION_TYPE@236..244 0: QUERY_KW@236..244 "query" [Newline("\n"), Whitespace(" ")] [] 1: COLON@244..246 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@246..251 - 0: GRAPHQL_NAME@246..251 - 0: GRAPHQL_NAME@246..251 "query" [] [] + 2: GRAPHQL_NAME_REFERENCE@246..251 + 0: IDENT@246..251 "query" [] [] 1: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@251..272 0: GRAPHQL_OPERATION_TYPE@251..262 0: MUTATION_KW@251..262 "mutation" [Newline("\n"), Whitespace(" ")] [] 1: COLON@262..264 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@264..272 - 0: GRAPHQL_NAME@264..272 - 0: GRAPHQL_NAME@264..272 "mutation" [] [] + 2: GRAPHQL_NAME_REFERENCE@264..272 + 0: IDENT@264..272 "mutation" [] [] 2: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@272..300 0: GRAPHQL_OPERATION_TYPE@272..286 0: SUBSCRIPTION_KW@272..286 "subscription" [Newline("\n"), Whitespace("\t")] [] 1: COLON@286..288 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@288..300 - 0: GRAPHQL_NAME@288..300 - 0: GRAPHQL_NAME@288..300 "subscription" [] [] + 2: GRAPHQL_NAME_REFERENCE@288..300 + 0: IDENT@288..300 "subscription" [] [] 2: R_CURLY@300..302 "}" [Newline("\n")] [] 2: EOF@302..303 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/schema_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/schema_extension.graphql.snap index 3788a9a24d5b..6c8a1fc6176d 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/schema_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/schema_extension.graphql.snap @@ -40,10 +40,8 @@ GraphqlRoot { value_token: QUERY_KW@15..23 "query" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@23..25 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@25..40 "MyQueryRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@25..40 "MyQueryRootType" [] [], }, }, GraphqlRootOperationTypeDefinition { @@ -51,10 +49,8 @@ GraphqlRoot { value_token: MUTATION_KW@40..51 "mutation" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@51..53 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@53..71 "MyMutationRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@53..71 "MyMutationRootType" [] [], }, }, GraphqlRootOperationTypeDefinition { @@ -62,10 +58,8 @@ GraphqlRoot { value_token: SUBSCRIPTION_KW@71..86 "subscription" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@86..88 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@88..110 "MySubscriptionRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@88..110 "MySubscriptionRootType" [] [], }, }, ], @@ -78,8 +72,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@128..129 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@129..134 "decs" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@129..134 "decs" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -92,10 +86,8 @@ GraphqlRoot { value_token: QUERY_KW@135..143 "query" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@143..145 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@145..160 "MyQueryRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@145..160 "MyQueryRootType" [] [], }, }, GraphqlRootOperationTypeDefinition { @@ -103,10 +95,8 @@ GraphqlRoot { value_token: MUTATION_KW@160..171 "mutation" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@171..173 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@173..191 "MyMutationRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@173..191 "MyMutationRootType" [] [], }, }, ], @@ -119,8 +109,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@209..210 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@210..215 "decs" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@210..215 "decs" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -133,10 +123,8 @@ GraphqlRoot { value_token: QUERY_KW@216..224 "query" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@224..226 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@226..241 "MyQueryRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@226..241 "MyQueryRootType" [] [], }, }, GraphqlRootOperationTypeDefinition { @@ -144,10 +132,8 @@ GraphqlRoot { value_token: MUTATION_KW@241..252 "mutation" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@252..254 ":" [] [Whitespace(" ")], - named_type: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@254..272 "MyMutationRootType" [] [], - }, + named_type: GraphqlNameReference { + value_token: IDENT@254..272 "MyMutationRootType" [] [], }, }, ], @@ -176,23 +162,20 @@ GraphqlRoot { 0: GRAPHQL_OPERATION_TYPE@15..23 0: QUERY_KW@15..23 "query" [Newline("\n"), Whitespace(" ")] [] 1: COLON@23..25 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@25..40 - 0: GRAPHQL_NAME@25..40 - 0: GRAPHQL_NAME@25..40 "MyQueryRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@25..40 + 0: IDENT@25..40 "MyQueryRootType" [] [] 1: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@40..71 0: GRAPHQL_OPERATION_TYPE@40..51 0: MUTATION_KW@40..51 "mutation" [Newline("\n"), Whitespace(" ")] [] 1: COLON@51..53 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@53..71 - 0: GRAPHQL_NAME@53..71 - 0: GRAPHQL_NAME@53..71 "MyMutationRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@53..71 + 0: IDENT@53..71 "MyMutationRootType" [] [] 2: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@71..110 0: GRAPHQL_OPERATION_TYPE@71..86 0: SUBSCRIPTION_KW@71..86 "subscription" [Newline("\n"), Whitespace(" ")] [] 1: COLON@86..88 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@88..110 - 0: GRAPHQL_NAME@88..110 - 0: GRAPHQL_NAME@88..110 "MySubscriptionRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@88..110 + 0: IDENT@88..110 "MySubscriptionRootType" [] [] 2: R_CURLY@110..112 "}" [Newline("\n")] [] 1: GRAPHQL_SCHEMA_EXTENSION@112..193 0: EXTEND_KW@112..121 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] @@ -200,8 +183,8 @@ GraphqlRoot { 2: GRAPHQL_DIRECTIVE_LIST@128..134 0: GRAPHQL_DIRECTIVE@128..134 0: AT@128..129 "@" [] [] - 1: GRAPHQL_NAME@129..134 - 0: GRAPHQL_NAME@129..134 "decs" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@129..134 + 0: IDENT@129..134 "decs" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_ROOT_OPERATION_TYPES@134..193 0: L_CURLY@134..135 "{" [] [] @@ -210,16 +193,14 @@ GraphqlRoot { 0: GRAPHQL_OPERATION_TYPE@135..143 0: QUERY_KW@135..143 "query" [Newline("\n"), Whitespace(" ")] [] 1: COLON@143..145 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@145..160 - 0: GRAPHQL_NAME@145..160 - 0: GRAPHQL_NAME@145..160 "MyQueryRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@145..160 + 0: IDENT@145..160 "MyQueryRootType" [] [] 1: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@160..191 0: GRAPHQL_OPERATION_TYPE@160..171 0: MUTATION_KW@160..171 "mutation" [Newline("\n"), Whitespace(" ")] [] 1: COLON@171..173 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@173..191 - 0: GRAPHQL_NAME@173..191 - 0: GRAPHQL_NAME@173..191 "MyMutationRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@173..191 + 0: IDENT@173..191 "MyMutationRootType" [] [] 2: R_CURLY@191..193 "}" [Newline("\n")] [] 2: GRAPHQL_SCHEMA_EXTENSION@193..274 0: EXTEND_KW@193..202 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] @@ -227,8 +208,8 @@ GraphqlRoot { 2: GRAPHQL_DIRECTIVE_LIST@209..215 0: GRAPHQL_DIRECTIVE@209..215 0: AT@209..210 "@" [] [] - 1: GRAPHQL_NAME@210..215 - 0: GRAPHQL_NAME@210..215 "decs" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@210..215 + 0: IDENT@210..215 "decs" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_ROOT_OPERATION_TYPES@215..274 0: L_CURLY@215..216 "{" [] [] @@ -237,16 +218,14 @@ GraphqlRoot { 0: GRAPHQL_OPERATION_TYPE@216..224 0: QUERY_KW@216..224 "query" [Newline("\n"), Whitespace(" ")] [] 1: COLON@224..226 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@226..241 - 0: GRAPHQL_NAME@226..241 - 0: GRAPHQL_NAME@226..241 "MyQueryRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@226..241 + 0: IDENT@226..241 "MyQueryRootType" [] [] 1: GRAPHQL_ROOT_OPERATION_TYPE_DEFINITION@241..272 0: GRAPHQL_OPERATION_TYPE@241..252 0: MUTATION_KW@241..252 "mutation" [Newline("\n"), Whitespace(" ")] [] 1: COLON@252..254 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@254..272 - 0: GRAPHQL_NAME@254..272 - 0: GRAPHQL_NAME@254..272 "MyMutationRootType" [] [] + 2: GRAPHQL_NAME_REFERENCE@254..272 + 0: IDENT@254..272 "MyMutationRootType" [] [] 2: R_CURLY@272..274 "}" [Newline("\n")] [] 2: EOF@274..275 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/union.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/union.graphql.snap index 8d6232bb96a7..a1bb118e9612 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/union.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/union.graphql.snap @@ -28,24 +28,20 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@0..6 "union" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@6..19 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@6..19 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], union_members: GraphqlUnionMemberTypes { eq_token: EQ@19..21 "=" [] [Whitespace(" ")], bitwise_or_token: missing (optional), members: GraphqlUnionMemberTypeList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@21..27 "Photo" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@21..27 "Photo" [] [Whitespace(" ")], }, PIPE@27..29 "|" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@29..35 "Person" [] [], - }, + GraphqlNameReference { + value_token: IDENT@29..35 "Person" [] [], }, ], }, @@ -53,30 +49,24 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@35..43 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@43..56 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@43..56 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], union_members: GraphqlUnionMemberTypes { eq_token: EQ@56..57 "=" [] [], bitwise_or_token: PIPE@57..61 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], members: GraphqlUnionMemberTypeList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@61..66 "Photo" [] [], - }, + GraphqlNameReference { + value_token: IDENT@61..66 "Photo" [] [], }, PIPE@66..70 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@70..76 "Person" [] [], - }, + GraphqlNameReference { + value_token: IDENT@70..76 "Person" [] [], }, PIPE@76..80 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@80..85 "union" [] [], - }, + GraphqlNameReference { + value_token: IDENT@80..85 "union" [] [], }, ], }, @@ -84,24 +74,20 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@85..93 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@93..99 "union" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@93..99 "union" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], union_members: GraphqlUnionMemberTypes { eq_token: EQ@99..101 "=" [] [Whitespace(" ")], bitwise_or_token: missing (optional), members: GraphqlUnionMemberTypeList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@101..107 "union" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@101..107 "union" [] [Whitespace(" ")], }, PIPE@107..109 "|" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@109..114 "union" [] [], - }, + GraphqlNameReference { + value_token: IDENT@109..114 "union" [] [], }, ], }, @@ -109,14 +95,14 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@114..122 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@122..135 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@122..135 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@135..136 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@136..146 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@136..146 "deprecated" [] [], }, arguments: missing (optional), }, @@ -126,14 +112,14 @@ GraphqlRoot { GraphqlUnionTypeDefinition { description: missing (optional), union_token: UNION_KW@146..154 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@154..167 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@154..167 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@167..168 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@168..179 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@168..179 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -142,16 +128,12 @@ GraphqlRoot { eq_token: EQ@179..181 "=" [] [Whitespace(" ")], bitwise_or_token: missing (optional), members: GraphqlUnionMemberTypeList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@181..187 "Photo" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@181..187 "Photo" [] [Whitespace(" ")], }, PIPE@187..189 "|" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@189..195 "Person" [] [], - }, + GraphqlNameReference { + value_token: IDENT@189..195 "Person" [] [], }, ], }, @@ -170,92 +152,83 @@ GraphqlRoot { 0: GRAPHQL_UNION_TYPE_DEFINITION@0..35 0: (empty) 1: UNION_KW@0..6 "union" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@6..19 - 0: GRAPHQL_NAME@6..19 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@6..19 + 0: IDENT@6..19 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@19..19 4: GRAPHQL_UNION_MEMBER_TYPES@19..35 0: EQ@19..21 "=" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_UNION_MEMBER_TYPE_LIST@21..35 - 0: GRAPHQL_NAMED_TYPE@21..27 - 0: GRAPHQL_NAME@21..27 - 0: GRAPHQL_NAME@21..27 "Photo" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@21..27 + 0: IDENT@21..27 "Photo" [] [Whitespace(" ")] 1: PIPE@27..29 "|" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@29..35 - 0: GRAPHQL_NAME@29..35 - 0: GRAPHQL_NAME@29..35 "Person" [] [] + 2: GRAPHQL_NAME_REFERENCE@29..35 + 0: IDENT@29..35 "Person" [] [] 1: GRAPHQL_UNION_TYPE_DEFINITION@35..85 0: (empty) 1: UNION_KW@35..43 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@43..56 - 0: GRAPHQL_NAME@43..56 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@43..56 + 0: IDENT@43..56 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@56..56 4: GRAPHQL_UNION_MEMBER_TYPES@56..85 0: EQ@56..57 "=" [] [] 1: PIPE@57..61 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 2: GRAPHQL_UNION_MEMBER_TYPE_LIST@61..85 - 0: GRAPHQL_NAMED_TYPE@61..66 - 0: GRAPHQL_NAME@61..66 - 0: GRAPHQL_NAME@61..66 "Photo" [] [] + 0: GRAPHQL_NAME_REFERENCE@61..66 + 0: IDENT@61..66 "Photo" [] [] 1: PIPE@66..70 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@70..76 - 0: GRAPHQL_NAME@70..76 - 0: GRAPHQL_NAME@70..76 "Person" [] [] + 2: GRAPHQL_NAME_REFERENCE@70..76 + 0: IDENT@70..76 "Person" [] [] 3: PIPE@76..80 "|" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] - 4: GRAPHQL_NAMED_TYPE@80..85 - 0: GRAPHQL_NAME@80..85 - 0: GRAPHQL_NAME@80..85 "union" [] [] + 4: GRAPHQL_NAME_REFERENCE@80..85 + 0: IDENT@80..85 "union" [] [] 2: GRAPHQL_UNION_TYPE_DEFINITION@85..114 0: (empty) 1: UNION_KW@85..93 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@93..99 - 0: GRAPHQL_NAME@93..99 "union" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@93..99 + 0: IDENT@93..99 "union" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@99..99 4: GRAPHQL_UNION_MEMBER_TYPES@99..114 0: EQ@99..101 "=" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_UNION_MEMBER_TYPE_LIST@101..114 - 0: GRAPHQL_NAMED_TYPE@101..107 - 0: GRAPHQL_NAME@101..107 - 0: GRAPHQL_NAME@101..107 "union" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@101..107 + 0: IDENT@101..107 "union" [] [Whitespace(" ")] 1: PIPE@107..109 "|" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@109..114 - 0: GRAPHQL_NAME@109..114 - 0: GRAPHQL_NAME@109..114 "union" [] [] + 2: GRAPHQL_NAME_REFERENCE@109..114 + 0: IDENT@109..114 "union" [] [] 3: GRAPHQL_UNION_TYPE_DEFINITION@114..146 0: (empty) 1: UNION_KW@114..122 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@122..135 - 0: GRAPHQL_NAME@122..135 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@122..135 + 0: IDENT@122..135 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@135..146 0: GRAPHQL_DIRECTIVE@135..146 0: AT@135..136 "@" [] [] - 1: GRAPHQL_NAME@136..146 - 0: GRAPHQL_NAME@136..146 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@136..146 + 0: IDENT@136..146 "deprecated" [] [] 2: (empty) 4: (empty) 4: GRAPHQL_UNION_TYPE_DEFINITION@146..195 0: (empty) 1: UNION_KW@146..154 "union" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 2: GRAPHQL_NAME@154..167 - 0: GRAPHQL_NAME@154..167 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_BINDING@154..167 + 0: IDENT@154..167 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@167..179 0: GRAPHQL_DIRECTIVE@167..179 0: AT@167..168 "@" [] [] - 1: GRAPHQL_NAME@168..179 - 0: GRAPHQL_NAME@168..179 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@168..179 + 0: IDENT@168..179 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_UNION_MEMBER_TYPES@179..195 0: EQ@179..181 "=" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_UNION_MEMBER_TYPE_LIST@181..195 - 0: GRAPHQL_NAMED_TYPE@181..187 - 0: GRAPHQL_NAME@181..187 - 0: GRAPHQL_NAME@181..187 "Photo" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@181..187 + 0: IDENT@181..187 "Photo" [] [Whitespace(" ")] 1: PIPE@187..189 "|" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@189..195 - 0: GRAPHQL_NAME@189..195 - 0: GRAPHQL_NAME@189..195 "Person" [] [] + 2: GRAPHQL_NAME_REFERENCE@189..195 + 0: IDENT@189..195 "Person" [] [] 2: EOF@195..196 "" [Newline("\n")] [] ``` diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/union_extension.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/union_extension.graphql.snap index b6c7ae6e6014..391cdbe3c7c6 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/union_extension.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/definitions/union_extension.graphql.snap @@ -19,24 +19,20 @@ GraphqlRoot { GraphqlUnionTypeExtension { extend_token: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")], union_token: UNION_KW@7..13 "union" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@13..26 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@13..26 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [], union_members: GraphqlUnionMemberTypes { eq_token: EQ@26..28 "=" [] [Whitespace(" ")], bitwise_or_token: missing (optional), members: GraphqlUnionMemberTypeList [ - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@28..34 "Photo" [] [Whitespace(" ")], - }, + GraphqlNameReference { + value_token: IDENT@28..34 "Photo" [] [Whitespace(" ")], }, PIPE@34..36 "|" [] [Whitespace(" ")], - GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@36..42 "Person" [] [], - }, + GraphqlNameReference { + value_token: IDENT@36..42 "Person" [] [], }, ], }, @@ -44,14 +40,14 @@ GraphqlRoot { GraphqlUnionTypeExtension { extend_token: EXTEND_KW@42..51 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")], union_token: UNION_KW@51..57 "union" [] [Whitespace(" ")], - name: GraphqlName { - value_token: GRAPHQL_NAME@57..70 "SearchResult" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@57..70 "SearchResult" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@70..71 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@71..81 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@71..81 "deprecated" [] [], }, arguments: missing (optional), }, @@ -72,30 +68,28 @@ GraphqlRoot { 0: GRAPHQL_UNION_TYPE_EXTENSION@0..42 0: EXTEND_KW@0..7 "extend" [] [Whitespace(" ")] 1: UNION_KW@7..13 "union" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@13..26 - 0: GRAPHQL_NAME@13..26 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@13..26 + 0: IDENT@13..26 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@26..26 4: GRAPHQL_UNION_MEMBER_TYPES@26..42 0: EQ@26..28 "=" [] [Whitespace(" ")] 1: (empty) 2: GRAPHQL_UNION_MEMBER_TYPE_LIST@28..42 - 0: GRAPHQL_NAMED_TYPE@28..34 - 0: GRAPHQL_NAME@28..34 - 0: GRAPHQL_NAME@28..34 "Photo" [] [Whitespace(" ")] + 0: GRAPHQL_NAME_REFERENCE@28..34 + 0: IDENT@28..34 "Photo" [] [Whitespace(" ")] 1: PIPE@34..36 "|" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@36..42 - 0: GRAPHQL_NAME@36..42 - 0: GRAPHQL_NAME@36..42 "Person" [] [] + 2: GRAPHQL_NAME_REFERENCE@36..42 + 0: IDENT@36..42 "Person" [] [] 1: GRAPHQL_UNION_TYPE_EXTENSION@42..81 0: EXTEND_KW@42..51 "extend" [Newline("\n"), Newline("\n")] [Whitespace(" ")] 1: UNION_KW@51..57 "union" [] [Whitespace(" ")] - 2: GRAPHQL_NAME@57..70 - 0: GRAPHQL_NAME@57..70 "SearchResult" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@57..70 + 0: IDENT@57..70 "SearchResult" [] [Whitespace(" ")] 3: GRAPHQL_DIRECTIVE_LIST@70..81 0: GRAPHQL_DIRECTIVE@70..81 0: AT@70..71 "@" [] [] - 1: GRAPHQL_NAME@71..81 - 0: GRAPHQL_NAME@71..81 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@71..81 + 0: IDENT@71..81 "deprecated" [] [] 2: (empty) 4: (empty) 2: EOF@81..82 "" [Newline("\n")] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/directive.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/directive.graphql.snap index 7dfcf7fd845f..16cab6b5b973 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/directive.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/directive.graphql.snap @@ -35,15 +35,15 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@1..9 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@1..9 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@9..10 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@10..20 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@10..20 "deprecated" [] [], }, arguments: missing (optional), }, @@ -58,22 +58,22 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@25..33 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@25..33 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@33..34 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@34..44 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@34..44 "deprecated" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@44..45 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@45..51 "reason" [] [], + name: GraphqlLiteralName { + value_token: IDENT@45..51 "reason" [] [], }, colon_token: COLON@51..53 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -95,27 +95,27 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@71..79 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@71..79 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@79..80 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@80..85 "input" [] [], + name: GraphqlNameReference { + value_token: IDENT@80..85 "input" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@85..86 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@86..90 "type" [] [], + name: GraphqlLiteralName { + value_token: IDENT@86..90 "type" [] [], }, colon_token: COLON@90..92 ":" [] [Whitespace(" ")], value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@92..98 "String" [] [], + value: GraphqlLiteralName { + value_token: IDENT@92..98 "String" [] [], }, }, }, @@ -134,22 +134,22 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@104..111 "hero" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@104..111 "hero" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@111..115 "@" [Newline("\n"), Whitespace("\t\t")] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@115..125 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@115..125 "deprecated" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@125..126 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@126..132 "reason" [] [], + name: GraphqlLiteralName { + value_token: IDENT@126..132 "reason" [] [], }, colon_token: COLON@132..134 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -162,15 +162,15 @@ GraphqlRoot { }, GraphqlDirective { at_token: AT@147..151 "@" [Newline("\n"), Whitespace("\t\t")] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@151..168 "addExternalFields" [] [], + name: GraphqlNameReference { + value_token: IDENT@151..168 "addExternalFields" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@168..169 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@169..175 "source" [] [], + name: GraphqlLiteralName { + value_token: IDENT@169..175 "source" [] [], }, colon_token: COLON@175..177 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -203,14 +203,14 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@1..20 0: GRAPHQL_FIELD@1..20 0: (empty) - 1: GRAPHQL_NAME@1..9 - 0: GRAPHQL_NAME@1..9 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@1..9 + 0: IDENT@1..9 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@9..20 0: GRAPHQL_DIRECTIVE@9..20 0: AT@9..10 "@" [] [] - 1: GRAPHQL_NAME@10..20 - 0: GRAPHQL_NAME@10..20 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@10..20 + 0: IDENT@10..20 "deprecated" [] [] 2: (empty) 4: (empty) 2: R_CURLY@20..22 "}" [Newline("\n")] [] @@ -219,20 +219,20 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@25..66 0: GRAPHQL_FIELD@25..66 0: (empty) - 1: GRAPHQL_NAME@25..33 - 0: GRAPHQL_NAME@25..33 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@25..33 + 0: IDENT@25..33 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@33..66 0: GRAPHQL_DIRECTIVE@33..66 0: AT@33..34 "@" [] [] - 1: GRAPHQL_NAME@34..44 - 0: GRAPHQL_NAME@34..44 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@34..44 + 0: IDENT@34..44 "deprecated" [] [] 2: GRAPHQL_ARGUMENTS@44..66 0: L_PAREN@44..45 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@45..65 0: GRAPHQL_ARGUMENT@45..65 - 0: GRAPHQL_NAME@45..51 - 0: GRAPHQL_NAME@45..51 "reason" [] [] + 0: GRAPHQL_LITERAL_NAME@45..51 + 0: IDENT@45..51 "reason" [] [] 1: COLON@51..53 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@53..65 0: GRAPHQL_STRING_LITERAL@53..65 "\"Deprecated\"" [] [] @@ -244,24 +244,24 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@71..99 0: GRAPHQL_FIELD@71..99 0: (empty) - 1: GRAPHQL_NAME@71..79 - 0: GRAPHQL_NAME@71..79 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@71..79 + 0: IDENT@71..79 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@79..99 0: GRAPHQL_DIRECTIVE@79..99 0: AT@79..80 "@" [] [] - 1: GRAPHQL_NAME@80..85 - 0: GRAPHQL_NAME@80..85 "input" [] [] + 1: GRAPHQL_NAME_REFERENCE@80..85 + 0: IDENT@80..85 "input" [] [] 2: GRAPHQL_ARGUMENTS@85..99 0: L_PAREN@85..86 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@86..98 0: GRAPHQL_ARGUMENT@86..98 - 0: GRAPHQL_NAME@86..90 - 0: GRAPHQL_NAME@86..90 "type" [] [] + 0: GRAPHQL_LITERAL_NAME@86..90 + 0: IDENT@86..90 "type" [] [] 1: COLON@90..92 ":" [] [Whitespace(" ")] 2: GRAPHQL_ENUM_VALUE@92..98 - 0: GRAPHQL_NAME@92..98 - 0: GRAPHQL_NAME@92..98 "String" [] [] + 0: GRAPHQL_LITERAL_NAME@92..98 + 0: IDENT@92..98 "String" [] [] 2: R_PAREN@98..99 ")" [] [] 4: (empty) 2: R_CURLY@99..101 "}" [Newline("\n")] [] @@ -270,34 +270,34 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@104..188 0: GRAPHQL_FIELD@104..188 0: (empty) - 1: GRAPHQL_NAME@104..111 - 0: GRAPHQL_NAME@104..111 "hero" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@104..111 + 0: IDENT@104..111 "hero" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@111..188 0: GRAPHQL_DIRECTIVE@111..147 0: AT@111..115 "@" [Newline("\n"), Whitespace("\t\t")] [] - 1: GRAPHQL_NAME@115..125 - 0: GRAPHQL_NAME@115..125 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@115..125 + 0: IDENT@115..125 "deprecated" [] [] 2: GRAPHQL_ARGUMENTS@125..147 0: L_PAREN@125..126 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@126..146 0: GRAPHQL_ARGUMENT@126..146 - 0: GRAPHQL_NAME@126..132 - 0: GRAPHQL_NAME@126..132 "reason" [] [] + 0: GRAPHQL_LITERAL_NAME@126..132 + 0: IDENT@126..132 "reason" [] [] 1: COLON@132..134 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@134..146 0: GRAPHQL_STRING_LITERAL@134..146 "\"Deprecated\"" [] [] 2: R_PAREN@146..147 ")" [] [] 1: GRAPHQL_DIRECTIVE@147..188 0: AT@147..151 "@" [Newline("\n"), Whitespace("\t\t")] [] - 1: GRAPHQL_NAME@151..168 - 0: GRAPHQL_NAME@151..168 "addExternalFields" [] [] + 1: GRAPHQL_NAME_REFERENCE@151..168 + 0: IDENT@151..168 "addExternalFields" [] [] 2: GRAPHQL_ARGUMENTS@168..188 0: L_PAREN@168..169 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@169..187 0: GRAPHQL_ARGUMENT@169..187 - 0: GRAPHQL_NAME@169..175 - 0: GRAPHQL_NAME@169..175 "source" [] [] + 0: GRAPHQL_LITERAL_NAME@169..175 + 0: IDENT@169..175 "source" [] [] 1: COLON@175..177 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@177..187 0: GRAPHQL_STRING_LITERAL@177..187 "\"profiles\"" [] [] diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/operation.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/operation.graphql.snap index ac59f1d99753..7a4370bb35a8 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/operation.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/operation.graphql.snap @@ -73,8 +73,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@7..19 "likeStory" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@7..19 "likeStory" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -89,8 +89,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@36..48 "likeStory" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@36..48 "likeStory" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -111,8 +111,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@62..73 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@62..73 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -134,8 +134,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@91..103 "storyLiked" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@91..103 "storyLiked" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -149,8 +149,8 @@ GraphqlRoot { ty: GraphqlOperationType { value_token: QUERY_KW@105..125 "query" [Newline("\n"), Newline("\n"), Comments("# with name"), Newline("\n")] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@125..135 "likeStory" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@125..135 "likeStory" [] [Whitespace(" ")], }, variables: missing (optional), directives: GraphqlDirectiveList [], @@ -159,8 +159,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@136..147 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@136..147 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -174,8 +174,8 @@ GraphqlRoot { ty: GraphqlOperationType { value_token: QUERY_KW@149..157 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@157..163 "query" [] [Whitespace(" ")], + name: GraphqlNameBinding { + value_token: IDENT@157..163 "query" [] [Whitespace(" ")], }, variables: missing (optional), directives: GraphqlDirectiveList [], @@ -184,8 +184,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@164..175 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@164..175 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -204,18 +204,16 @@ GraphqlRoot { l_paren_token: L_PAREN@202..203 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@203..204 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@204..211 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@204..211 "storyId" [] [], }, }, colon_token: COLON@211..213 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@213..215 "ID" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@213..215 "ID" [] [], }, excl_token: BANG@215..216 "!" [] [], }, @@ -231,21 +229,21 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@219..230 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@219..230 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@230..231 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@231..238 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@231..238 "storyId" [] [], }, colon_token: COLON@238..240 ":" [] [Whitespace(" ")], - value: GraphqlVariable { + value: GraphqlVariableReference { dollar_token: DOLLAR@240..241 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@241..248 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@241..248 "storyId" [] [], }, }, }, @@ -268,17 +266,15 @@ GraphqlRoot { l_paren_token: L_PAREN@259..260 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@260..261 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@261..268 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@261..268 "storyId" [] [], }, }, colon_token: COLON@268..270 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@270..273 "ID" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@270..273 "ID" [] [Whitespace(" ")], }, default: GraphqlDefaultValue { eq_token: EQ@273..275 "=" [] [Whitespace(" ")], @@ -297,21 +293,21 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@281..292 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@281..292 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@292..293 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@293..300 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@293..300 "storyId" [] [], }, colon_token: COLON@300..302 ":" [] [Whitespace(" ")], - value: GraphqlVariable { + value: GraphqlVariableReference { dollar_token: DOLLAR@302..303 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@303..310 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@303..310 "storyId" [] [], }, }, }, @@ -334,18 +330,16 @@ GraphqlRoot { l_paren_token: L_PAREN@339..340 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@340..341 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@341..348 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@341..348 "storyId" [] [], }, }, colon_token: COLON@348..350 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@350..352 "ID" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@350..352 "ID" [] [], }, excl_token: BANG@352..353 "!" [] [], }, @@ -358,15 +352,15 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@355..356 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@356..360 "skip" [] [], + name: GraphqlNameReference { + value_token: IDENT@356..360 "skip" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@360..361 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@361..363 "if" [] [], + name: GraphqlLiteralName { + value_token: IDENT@361..363 "if" [] [], }, colon_token: COLON@363..365 ":" [] [Whitespace(" ")], value: GraphqlBooleanValue { @@ -383,21 +377,21 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@371..382 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@371..382 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@382..383 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@383..390 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@383..390 "storyId" [] [], }, colon_token: COLON@390..392 ":" [] [Whitespace(" ")], - value: GraphqlVariable { + value: GraphqlVariableReference { dollar_token: DOLLAR@392..393 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@393..400 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@393..400 "storyId" [] [], }, }, }, @@ -415,24 +409,22 @@ GraphqlRoot { ty: GraphqlOperationType { value_token: QUERY_KW@403..411 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@411..415 "enum" [] [], + name: GraphqlNameBinding { + value_token: IDENT@411..415 "enum" [] [], }, variables: GraphqlVariableDefinitions { l_paren_token: L_PAREN@415..416 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@416..417 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@417..421 "true" [] [], + name: GraphqlLiteralName { + value_token: IDENT@417..421 "true" [] [], }, }, colon_token: COLON@421..423 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@423..428 "false" [] [], - }, + ty: GraphqlNameReference { + value_token: IDENT@423..428 "false" [] [], }, default: missing (optional), directives: GraphqlDirectiveList [], @@ -446,8 +438,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@431..438 "null" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@431..438 "null" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -455,8 +447,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@438..449 "mutation" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@438..449 "mutation" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -464,8 +456,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@449..457 "enum" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@449..457 "enum" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -473,15 +465,15 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@457..467 "Direction" [] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@457..467 "Direction" [] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@467..468 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@468..479 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@468..479 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -491,8 +483,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@480..490 "NORTH" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@480..490 "NORTH" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -500,8 +492,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@490..499 "WEST" [Newline("\n"), Whitespace(" ")] [], + name: GraphqlLiteralName { + value_token: IDENT@490..499 "WEST" [Newline("\n"), Whitespace(" ")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -537,8 +529,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@7..19 0: GRAPHQL_FIELD@7..19 0: (empty) - 1: GRAPHQL_NAME@7..19 - 0: GRAPHQL_NAME@7..19 "likeStory" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@7..19 + 0: IDENT@7..19 "likeStory" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@19..19 4: (empty) @@ -548,8 +540,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@36..48 0: GRAPHQL_FIELD@36..48 0: (empty) - 1: GRAPHQL_NAME@36..48 - 0: GRAPHQL_NAME@36..48 "likeStory" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@36..48 + 0: IDENT@36..48 "likeStory" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@48..48 4: (empty) @@ -565,8 +557,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@62..73 0: GRAPHQL_FIELD@62..73 0: (empty) - 1: GRAPHQL_NAME@62..73 - 0: GRAPHQL_NAME@62..73 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@62..73 + 0: IDENT@62..73 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@73..73 4: (empty) @@ -582,8 +574,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@91..103 0: GRAPHQL_FIELD@91..103 0: (empty) - 1: GRAPHQL_NAME@91..103 - 0: GRAPHQL_NAME@91..103 "storyLiked" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@91..103 + 0: IDENT@91..103 "storyLiked" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@103..103 4: (empty) @@ -591,8 +583,8 @@ GraphqlRoot { 4: GRAPHQL_OPERATION_DEFINITION@105..149 0: GRAPHQL_OPERATION_TYPE@105..125 0: QUERY_KW@105..125 "query" [Newline("\n"), Newline("\n"), Comments("# with name"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@125..135 - 0: GRAPHQL_NAME@125..135 "likeStory" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@125..135 + 0: IDENT@125..135 "likeStory" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@135..135 4: GRAPHQL_SELECTION_SET@135..149 @@ -600,8 +592,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@136..147 0: GRAPHQL_FIELD@136..147 0: (empty) - 1: GRAPHQL_NAME@136..147 - 0: GRAPHQL_NAME@136..147 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@136..147 + 0: IDENT@136..147 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@147..147 4: (empty) @@ -609,8 +601,8 @@ GraphqlRoot { 5: GRAPHQL_OPERATION_DEFINITION@149..177 0: GRAPHQL_OPERATION_TYPE@149..157 0: QUERY_KW@149..157 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@157..163 - 0: GRAPHQL_NAME@157..163 "query" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_BINDING@157..163 + 0: IDENT@157..163 "query" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@163..163 4: GRAPHQL_SELECTION_SET@163..177 @@ -618,8 +610,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@164..175 0: GRAPHQL_FIELD@164..175 0: (empty) - 1: GRAPHQL_NAME@164..175 - 0: GRAPHQL_NAME@164..175 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@164..175 + 0: IDENT@164..175 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@175..175 4: (empty) @@ -632,15 +624,14 @@ GraphqlRoot { 0: L_PAREN@202..203 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@203..216 0: GRAPHQL_VARIABLE_DEFINITION@203..216 - 0: GRAPHQL_VARIABLE@203..211 + 0: GRAPHQL_VARIABLE_BINDING@203..211 0: DOLLAR@203..204 "$" [] [] - 1: GRAPHQL_NAME@204..211 - 0: GRAPHQL_NAME@204..211 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@204..211 + 0: IDENT@204..211 "storyId" [] [] 1: COLON@211..213 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@213..216 - 0: GRAPHQL_NAMED_TYPE@213..215 - 0: GRAPHQL_NAME@213..215 - 0: GRAPHQL_NAME@213..215 "ID" [] [] + 0: GRAPHQL_NAME_REFERENCE@213..215 + 0: IDENT@213..215 "ID" [] [] 1: BANG@215..216 "!" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@216..216 @@ -651,19 +642,19 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@219..249 0: GRAPHQL_FIELD@219..249 0: (empty) - 1: GRAPHQL_NAME@219..230 - 0: GRAPHQL_NAME@219..230 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@219..230 + 0: IDENT@219..230 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@230..249 0: L_PAREN@230..231 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@231..248 0: GRAPHQL_ARGUMENT@231..248 - 0: GRAPHQL_NAME@231..238 - 0: GRAPHQL_NAME@231..238 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@231..238 + 0: IDENT@231..238 "storyId" [] [] 1: COLON@238..240 ":" [] [Whitespace(" ")] - 2: GRAPHQL_VARIABLE@240..248 + 2: GRAPHQL_VARIABLE_REFERENCE@240..248 0: DOLLAR@240..241 "$" [] [] - 1: GRAPHQL_NAME@241..248 - 0: GRAPHQL_NAME@241..248 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@241..248 + 0: IDENT@241..248 "storyId" [] [] 2: R_PAREN@248..249 ")" [] [] 3: GRAPHQL_DIRECTIVE_LIST@249..249 4: (empty) @@ -676,14 +667,13 @@ GraphqlRoot { 0: L_PAREN@259..260 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@260..278 0: GRAPHQL_VARIABLE_DEFINITION@260..278 - 0: GRAPHQL_VARIABLE@260..268 + 0: GRAPHQL_VARIABLE_BINDING@260..268 0: DOLLAR@260..261 "$" [] [] - 1: GRAPHQL_NAME@261..268 - 0: GRAPHQL_NAME@261..268 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@261..268 + 0: IDENT@261..268 "storyId" [] [] 1: COLON@268..270 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@270..273 - 0: GRAPHQL_NAME@270..273 - 0: GRAPHQL_NAME@270..273 "ID" [] [Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@270..273 + 0: IDENT@270..273 "ID" [] [Whitespace(" ")] 3: GRAPHQL_DEFAULT_VALUE@273..278 0: EQ@273..275 "=" [] [Whitespace(" ")] 1: GRAPHQL_STRING_VALUE@275..278 @@ -696,19 +686,19 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@281..311 0: GRAPHQL_FIELD@281..311 0: (empty) - 1: GRAPHQL_NAME@281..292 - 0: GRAPHQL_NAME@281..292 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@281..292 + 0: IDENT@281..292 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@292..311 0: L_PAREN@292..293 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@293..310 0: GRAPHQL_ARGUMENT@293..310 - 0: GRAPHQL_NAME@293..300 - 0: GRAPHQL_NAME@293..300 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@293..300 + 0: IDENT@293..300 "storyId" [] [] 1: COLON@300..302 ":" [] [Whitespace(" ")] - 2: GRAPHQL_VARIABLE@302..310 + 2: GRAPHQL_VARIABLE_REFERENCE@302..310 0: DOLLAR@302..303 "$" [] [] - 1: GRAPHQL_NAME@303..310 - 0: GRAPHQL_NAME@303..310 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@303..310 + 0: IDENT@303..310 "storyId" [] [] 2: R_PAREN@310..311 ")" [] [] 3: GRAPHQL_DIRECTIVE_LIST@311..311 4: (empty) @@ -721,15 +711,14 @@ GraphqlRoot { 0: L_PAREN@339..340 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@340..353 0: GRAPHQL_VARIABLE_DEFINITION@340..353 - 0: GRAPHQL_VARIABLE@340..348 + 0: GRAPHQL_VARIABLE_BINDING@340..348 0: DOLLAR@340..341 "$" [] [] - 1: GRAPHQL_NAME@341..348 - 0: GRAPHQL_NAME@341..348 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@341..348 + 0: IDENT@341..348 "storyId" [] [] 1: COLON@348..350 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@350..353 - 0: GRAPHQL_NAMED_TYPE@350..352 - 0: GRAPHQL_NAME@350..352 - 0: GRAPHQL_NAME@350..352 "ID" [] [] + 0: GRAPHQL_NAME_REFERENCE@350..352 + 0: IDENT@350..352 "ID" [] [] 1: BANG@352..353 "!" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@353..353 @@ -737,14 +726,14 @@ GraphqlRoot { 3: GRAPHQL_DIRECTIVE_LIST@355..370 0: GRAPHQL_DIRECTIVE@355..370 0: AT@355..356 "@" [] [] - 1: GRAPHQL_NAME@356..360 - 0: GRAPHQL_NAME@356..360 "skip" [] [] + 1: GRAPHQL_NAME_REFERENCE@356..360 + 0: IDENT@356..360 "skip" [] [] 2: GRAPHQL_ARGUMENTS@360..370 0: L_PAREN@360..361 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@361..369 0: GRAPHQL_ARGUMENT@361..369 - 0: GRAPHQL_NAME@361..363 - 0: GRAPHQL_NAME@361..363 "if" [] [] + 0: GRAPHQL_LITERAL_NAME@361..363 + 0: IDENT@361..363 "if" [] [] 1: COLON@363..365 ":" [] [Whitespace(" ")] 2: GRAPHQL_BOOLEAN_VALUE@365..369 0: TRUE_KW@365..369 "true" [] [] @@ -754,19 +743,19 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@371..401 0: GRAPHQL_FIELD@371..401 0: (empty) - 1: GRAPHQL_NAME@371..382 - 0: GRAPHQL_NAME@371..382 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@371..382 + 0: IDENT@371..382 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@382..401 0: L_PAREN@382..383 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@383..400 0: GRAPHQL_ARGUMENT@383..400 - 0: GRAPHQL_NAME@383..390 - 0: GRAPHQL_NAME@383..390 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@383..390 + 0: IDENT@383..390 "storyId" [] [] 1: COLON@390..392 ":" [] [Whitespace(" ")] - 2: GRAPHQL_VARIABLE@392..400 + 2: GRAPHQL_VARIABLE_REFERENCE@392..400 0: DOLLAR@392..393 "$" [] [] - 1: GRAPHQL_NAME@393..400 - 0: GRAPHQL_NAME@393..400 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@393..400 + 0: IDENT@393..400 "storyId" [] [] 2: R_PAREN@400..401 ")" [] [] 3: GRAPHQL_DIRECTIVE_LIST@401..401 4: (empty) @@ -774,20 +763,19 @@ GraphqlRoot { 9: GRAPHQL_OPERATION_DEFINITION@403..505 0: GRAPHQL_OPERATION_TYPE@403..411 0: QUERY_KW@403..411 "query" [Newline("\n"), Newline("\n")] [Whitespace(" ")] - 1: GRAPHQL_NAME@411..415 - 0: GRAPHQL_NAME@411..415 "enum" [] [] + 1: GRAPHQL_NAME_BINDING@411..415 + 0: IDENT@411..415 "enum" [] [] 2: GRAPHQL_VARIABLE_DEFINITIONS@415..430 0: L_PAREN@415..416 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@416..428 0: GRAPHQL_VARIABLE_DEFINITION@416..428 - 0: GRAPHQL_VARIABLE@416..421 + 0: GRAPHQL_VARIABLE_BINDING@416..421 0: DOLLAR@416..417 "$" [] [] - 1: GRAPHQL_NAME@417..421 - 0: GRAPHQL_NAME@417..421 "true" [] [] + 1: GRAPHQL_LITERAL_NAME@417..421 + 0: IDENT@417..421 "true" [] [] 1: COLON@421..423 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@423..428 - 0: GRAPHQL_NAME@423..428 - 0: GRAPHQL_NAME@423..428 "false" [] [] + 2: GRAPHQL_NAME_REFERENCE@423..428 + 0: IDENT@423..428 "false" [] [] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@428..428 2: R_PAREN@428..430 ")" [] [Whitespace(" ")] @@ -797,50 +785,50 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@431..503 0: GRAPHQL_FIELD@431..438 0: (empty) - 1: GRAPHQL_NAME@431..438 - 0: GRAPHQL_NAME@431..438 "null" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@431..438 + 0: IDENT@431..438 "null" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@438..438 4: (empty) 1: GRAPHQL_FIELD@438..449 0: (empty) - 1: GRAPHQL_NAME@438..449 - 0: GRAPHQL_NAME@438..449 "mutation" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@438..449 + 0: IDENT@438..449 "mutation" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@449..449 4: (empty) 2: GRAPHQL_FIELD@449..457 0: (empty) - 1: GRAPHQL_NAME@449..457 - 0: GRAPHQL_NAME@449..457 "enum" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@449..457 + 0: IDENT@449..457 "enum" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@457..457 4: (empty) 3: GRAPHQL_FIELD@457..503 0: (empty) - 1: GRAPHQL_NAME@457..467 - 0: GRAPHQL_NAME@457..467 "Direction" [] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@457..467 + 0: IDENT@457..467 "Direction" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@467..479 0: GRAPHQL_DIRECTIVE@467..479 0: AT@467..468 "@" [] [] - 1: GRAPHQL_NAME@468..479 - 0: GRAPHQL_NAME@468..479 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@468..479 + 0: IDENT@468..479 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_SELECTION_SET@479..503 0: L_CURLY@479..480 "{" [] [] 1: GRAPHQL_SELECTION_LIST@480..499 0: GRAPHQL_FIELD@480..490 0: (empty) - 1: GRAPHQL_NAME@480..490 - 0: GRAPHQL_NAME@480..490 "NORTH" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@480..490 + 0: IDENT@480..490 "NORTH" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@490..490 4: (empty) 1: GRAPHQL_FIELD@490..499 0: (empty) - 1: GRAPHQL_NAME@490..499 - 0: GRAPHQL_NAME@490..499 "WEST" [Newline("\n"), Whitespace(" ")] [] + 1: GRAPHQL_LITERAL_NAME@490..499 + 0: IDENT@490..499 "WEST" [Newline("\n"), Whitespace(" ")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@499..499 4: (empty) diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/selection_set.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/selection_set.graphql.snap index b998e268be07..33a535d3091c 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/selection_set.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/selection_set.graphql.snap @@ -132,8 +132,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@1..7 "hero" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@1..7 "hero" [Newline("\n"), Whitespace("\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -147,8 +147,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@33..40 "hero" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@33..40 "hero" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -157,8 +157,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@41..49 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@41..49 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -166,8 +166,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@49..55 "age" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@49..55 "age" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -185,15 +185,15 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@79..85 "hero" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@79..85 "hero" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@85..86 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@86..90 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@86..90 "name" [] [], }, colon_token: COLON@90..92 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -214,15 +214,15 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@110..116 "hero" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@110..116 "hero" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@116..117 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@117..121 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@117..121 "name" [] [], }, colon_token: COLON@121..123 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -238,8 +238,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@138..149 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@138..149 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -247,8 +247,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@149..157 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@149..157 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -256,8 +256,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@157..163 "age" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@157..163 "age" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -275,15 +275,15 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@171..177 "hero" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@171..177 "hero" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@177..178 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@178..185 "name" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@178..185 "name" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@185..187 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -291,8 +291,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@200..206 "age" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@200..206 "age" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@206..208 ":" [] [Whitespace(" ")], value: GraphqlIntValue { @@ -300,8 +300,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@211..220 "height" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@211..220 "height" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@220..222 ":" [] [Whitespace(" ")], value: GraphqlFloatValue { @@ -309,8 +309,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@225..233 "alive" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@225..233 "alive" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@233..235 ":" [] [Whitespace(" ")], value: GraphqlBooleanValue { @@ -318,8 +318,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@241..252 "location" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@241..252 "location" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@252..254 ":" [] [Whitespace(" ")], value: GraphqlNullValue { @@ -327,16 +327,16 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@258..271 "birthplace" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@258..271 "birthplace" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@271..273 ":" [] [Whitespace(" ")], value: GraphqlObjectValue { l_curly_token: L_CURLY@273..274 "{" [] [], members: GraphqlObjectValueMemberList [ GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@274..278 "city" [] [], + name: GraphqlLiteralName { + value_token: IDENT@274..278 "city" [] [], }, colon_token: COLON@278..280 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -344,8 +344,8 @@ GraphqlRoot { }, }, GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@292..297 "state" [] [], + name: GraphqlLiteralName { + value_token: IDENT@292..297 "state" [] [], }, colon_token: COLON@297..299 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -353,8 +353,8 @@ GraphqlRoot { }, }, GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@305..312 "country" [] [], + name: GraphqlLiteralName { + value_token: IDENT@305..312 "country" [] [], }, colon_token: COLON@312..314 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -366,8 +366,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@320..330 "friends" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@320..330 "friends" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@330..332 ":" [] [Whitespace(" ")], value: GraphqlListValue { @@ -392,8 +392,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@357..368 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@357..368 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -401,8 +401,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@368..376 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@368..376 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -410,8 +410,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@376..383 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@376..383 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -419,20 +419,20 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@383..392 "height" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@383..392 "height" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@392..393 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@393..397 "unit" [] [], + name: GraphqlLiteralName { + value_token: IDENT@393..397 "unit" [] [], }, colon_token: COLON@397..399 ":" [] [Whitespace(" ")], value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@399..403 "FOOT" [] [], + value: GraphqlLiteralName { + value_token: IDENT@399..403 "FOOT" [] [], }, }, }, @@ -444,15 +444,15 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@405..412 "wife" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@405..412 "wife" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@412..413 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@413..417 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@413..417 "name" [] [], }, colon_token: COLON@417..419 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -468,8 +468,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@429..437 "name" [Newline("\n"), Whitespace("\t\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@429..437 "name" [Newline("\n"), Whitespace("\t\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -491,21 +491,21 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@449..455 "hero" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@449..455 "hero" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@455..456 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@456..460 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@456..460 "name" [] [], }, colon_token: COLON@460..462 ":" [] [Whitespace(" ")], - value: GraphqlVariable { + value: GraphqlVariableReference { dollar_token: DOLLAR@462..463 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@463..467 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@463..467 "name" [] [], }, }, }, @@ -523,20 +523,20 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@488..498 "ironMan" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@488..498 "ironMan" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@498..500 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@500..504 "hero" [] [], + name: GraphqlLiteralName { + value_token: IDENT@500..504 "hero" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@504..505 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@505..509 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@505..509 "name" [] [], }, colon_token: COLON@509..511 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -557,20 +557,20 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@529..539 "ironMan" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@529..539 "ironMan" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@539..541 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@541..545 "hero" [] [], + name: GraphqlLiteralName { + value_token: IDENT@541..545 "hero" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@545..546 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@546..550 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@546..550 "name" [] [], }, colon_token: COLON@550..552 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -586,8 +586,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@567..578 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@567..578 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -595,8 +595,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@578..586 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@578..586 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -604,8 +604,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@586..593 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@586..593 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -613,20 +613,20 @@ GraphqlRoot { }, GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@593..605 "firstWife" [Newline("\n"), Whitespace("\t\t")] [], + value: GraphqlLiteralName { + value_token: IDENT@593..605 "firstWife" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@605..607 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@607..611 "wife" [] [], + name: GraphqlLiteralName { + value_token: IDENT@607..611 "wife" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@611..612 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@612..616 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@612..616 "name" [] [], }, colon_token: COLON@616..618 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -642,8 +642,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@628..636 "name" [Newline("\n"), Whitespace("\t\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@628..636 "name" [Newline("\n"), Whitespace("\t\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -665,15 +665,15 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@666..674 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@666..674 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@674..675 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@675..685 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@675..685 "deprecated" [] [], }, arguments: missing (optional), }, @@ -688,20 +688,20 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@690..700 "ironMan" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@690..700 "ironMan" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@700..702 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@702..706 "hero" [] [], + name: GraphqlLiteralName { + value_token: IDENT@702..706 "hero" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@706..707 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@707..711 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@707..711 "name" [] [], }, colon_token: COLON@711..713 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -714,8 +714,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@727..728 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@728..739 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@728..739 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -725,15 +725,15 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@740..751 "country" [Newline("\n"), Whitespace("\t\t")] [Whitespace(" ")], + name: GraphqlLiteralName { + value_token: IDENT@740..751 "country" [Newline("\n"), Whitespace("\t\t")] [Whitespace(" ")], }, arguments: missing (optional), directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@751..752 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@752..763 "deprecated" [] [Skipped(",")], + name: GraphqlNameReference { + value_token: IDENT@752..763 "deprecated" [] [Skipped(",")], }, arguments: missing (optional), }, @@ -742,8 +742,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@763..771 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@763..771 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -751,8 +751,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@771..777 "age" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@771..777 "age" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -770,8 +770,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlFragmentSpread { dotdotdot_token: DOT3@803..809 "..." [Newline("\n"), Whitespace(" ")] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@809..821 "heroFragment" [] [], + name: GraphqlNameReference { + value_token: IDENT@809..821 "heroFragment" [] [], }, directives: GraphqlDirectiveList [], }, @@ -783,14 +783,14 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlFragmentSpread { dotdotdot_token: DOT3@826..832 "..." [Newline("\n"), Whitespace(" ")] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@832..845 "heroFragment" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@832..845 "heroFragment" [] [Whitespace(" ")], }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@845..846 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@846..856 "deprecated" [] [], + name: GraphqlNameReference { + value_token: IDENT@846..856 "deprecated" [] [], }, arguments: missing (optional), }, @@ -804,20 +804,20 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@861..871 "ironMan" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@861..871 "ironMan" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@871..873 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@873..877 "hero" [] [], + name: GraphqlLiteralName { + value_token: IDENT@873..877 "hero" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@877..878 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@878..882 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@878..882 "name" [] [], }, colon_token: COLON@882..884 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -830,8 +830,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@898..899 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@899..910 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@899..910 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -841,8 +841,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlFragmentSpread { dotdotdot_token: DOT3@911..917 "..." [Newline("\n"), Whitespace("\t\t")] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@917..931 "heroAttributes" [] [], + name: GraphqlNameReference { + value_token: IDENT@917..931 "heroAttributes" [] [], }, directives: GraphqlDirectiveList [], }, @@ -865,8 +865,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@972..979 "hero" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@972..979 "hero" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -888,8 +888,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@994..995 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@995..1006 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@995..1006 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -899,8 +899,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@1007..1014 "hero" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@1007..1014 "hero" [Newline("\n"), Whitespace("\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -918,20 +918,20 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: GraphqlAlias { - value: GraphqlName { - value_token: GRAPHQL_NAME@1022..1032 "ironMan" [Newline("\n"), Whitespace(" ")] [], + value: GraphqlLiteralName { + value_token: IDENT@1022..1032 "ironMan" [Newline("\n"), Whitespace(" ")] [], }, colon_token: COLON@1032..1034 ":" [] [Whitespace(" ")], }, - name: GraphqlName { - value_token: GRAPHQL_NAME@1034..1038 "hero" [] [], + name: GraphqlLiteralName { + value_token: IDENT@1034..1038 "hero" [] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@1038..1039 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@1039..1043 "name" [] [], + name: GraphqlLiteralName { + value_token: IDENT@1039..1043 "name" [] [], }, colon_token: COLON@1043..1045 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -944,8 +944,8 @@ GraphqlRoot { directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@1059..1060 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@1060..1071 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@1060..1071 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -957,17 +957,15 @@ GraphqlRoot { dotdotdot_token: DOT3@1072..1079 "..." [Newline("\n"), Whitespace("\t\t")] [Whitespace(" ")], type_condition: GraphqlTypeCondition { on_token: ON_KW@1079..1082 "on" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@1082..1087 "Hero" [] [Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@1082..1087 "Hero" [] [Whitespace(" ")], }, }, directives: GraphqlDirectiveList [ GraphqlDirective { at_token: AT@1087..1088 "@" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@1088..1099 "deprecated" [] [Whitespace(" ")], + name: GraphqlNameReference { + value_token: IDENT@1088..1099 "deprecated" [] [Whitespace(" ")], }, arguments: missing (optional), }, @@ -977,8 +975,8 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@1100..1109 "name" [Newline("\n"), Whitespace("\t\t\t")] [Skipped(",")], + name: GraphqlLiteralName { + value_token: IDENT@1100..1109 "name" [Newline("\n"), Whitespace("\t\t\t")] [Skipped(",")], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -986,8 +984,8 @@ GraphqlRoot { }, GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@1109..1116 "age" [Newline("\n"), Whitespace("\t\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@1109..1116 "age" [Newline("\n"), Whitespace("\t\t\t")] [], }, arguments: missing (optional), directives: GraphqlDirectiveList [], @@ -1020,8 +1018,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@1..7 0: GRAPHQL_FIELD@1..7 0: (empty) - 1: GRAPHQL_NAME@1..7 - 0: GRAPHQL_NAME@1..7 "hero" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@1..7 + 0: IDENT@1..7 "hero" [Newline("\n"), Whitespace("\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@7..7 4: (empty) @@ -1031,8 +1029,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@33..58 0: GRAPHQL_FIELD@33..58 0: (empty) - 1: GRAPHQL_NAME@33..40 - 0: GRAPHQL_NAME@33..40 "hero" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@33..40 + 0: IDENT@33..40 "hero" [Newline("\n"), Whitespace("\t")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@40..40 4: GRAPHQL_SELECTION_SET@40..58 @@ -1040,15 +1038,15 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@41..55 0: GRAPHQL_FIELD@41..49 0: (empty) - 1: GRAPHQL_NAME@41..49 - 0: GRAPHQL_NAME@41..49 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@41..49 + 0: IDENT@41..49 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@49..49 4: (empty) 1: GRAPHQL_FIELD@49..55 0: (empty) - 1: GRAPHQL_NAME@49..55 - 0: GRAPHQL_NAME@49..55 "age" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@49..55 + 0: IDENT@49..55 "age" [Newline("\n"), Whitespace("\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@55..55 4: (empty) @@ -1059,14 +1057,14 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@79..105 0: GRAPHQL_FIELD@79..105 0: (empty) - 1: GRAPHQL_NAME@79..85 - 0: GRAPHQL_NAME@79..85 "hero" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@79..85 + 0: IDENT@79..85 "hero" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@85..105 0: L_PAREN@85..86 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@86..104 0: GRAPHQL_ARGUMENT@86..104 - 0: GRAPHQL_NAME@86..90 - 0: GRAPHQL_NAME@86..90 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@86..90 + 0: IDENT@86..90 "name" [] [] 1: COLON@90..92 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@92..104 0: GRAPHQL_STRING_LITERAL@92..104 "\"Tony Stark\"" [] [] @@ -1079,14 +1077,14 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@110..166 0: GRAPHQL_FIELD@110..166 0: (empty) - 1: GRAPHQL_NAME@110..116 - 0: GRAPHQL_NAME@110..116 "hero" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@110..116 + 0: IDENT@110..116 "hero" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@116..137 0: L_PAREN@116..117 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@117..135 0: GRAPHQL_ARGUMENT@117..135 - 0: GRAPHQL_NAME@117..121 - 0: GRAPHQL_NAME@117..121 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@117..121 + 0: IDENT@117..121 "name" [] [] 1: COLON@121..123 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@123..135 0: GRAPHQL_STRING_LITERAL@123..135 "\"Tony Stark\"" [] [] @@ -1097,22 +1095,22 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@138..163 0: GRAPHQL_FIELD@138..149 0: (empty) - 1: GRAPHQL_NAME@138..149 - 0: GRAPHQL_NAME@138..149 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@138..149 + 0: IDENT@138..149 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@149..149 4: (empty) 1: GRAPHQL_FIELD@149..157 0: (empty) - 1: GRAPHQL_NAME@149..157 - 0: GRAPHQL_NAME@149..157 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@149..157 + 0: IDENT@149..157 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@157..157 4: (empty) 2: GRAPHQL_FIELD@157..163 0: (empty) - 1: GRAPHQL_NAME@157..163 - 0: GRAPHQL_NAME@157..163 "age" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@157..163 + 0: IDENT@157..163 "age" [Newline("\n"), Whitespace("\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@163..163 4: (empty) @@ -1123,70 +1121,70 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@171..444 0: GRAPHQL_FIELD@171..444 0: (empty) - 1: GRAPHQL_NAME@171..177 - 0: GRAPHQL_NAME@171..177 "hero" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@171..177 + 0: IDENT@171..177 "hero" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@177..356 0: L_PAREN@177..178 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@178..352 0: GRAPHQL_ARGUMENT@178..200 - 0: GRAPHQL_NAME@178..185 - 0: GRAPHQL_NAME@178..185 "name" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@178..185 + 0: IDENT@178..185 "name" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@185..187 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@187..200 0: GRAPHQL_STRING_LITERAL@187..200 "\"Tony Stark\"" [] [Skipped(",")] 1: GRAPHQL_ARGUMENT@200..211 - 0: GRAPHQL_NAME@200..206 - 0: GRAPHQL_NAME@200..206 "age" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@200..206 + 0: IDENT@200..206 "age" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@206..208 ":" [] [Whitespace(" ")] 2: GRAPHQL_INT_VALUE@208..211 0: GRAPHQL_INT_LITERAL@208..211 "53" [] [Skipped(",")] 2: GRAPHQL_ARGUMENT@211..225 - 0: GRAPHQL_NAME@211..220 - 0: GRAPHQL_NAME@211..220 "height" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@211..220 + 0: IDENT@211..220 "height" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@220..222 ":" [] [Whitespace(" ")] 2: GRAPHQL_FLOAT_VALUE@222..225 0: GRAPHQL_FLOAT_LITERAL@222..225 "6.1" [] [] 3: GRAPHQL_ARGUMENT@225..241 - 0: GRAPHQL_NAME@225..233 - 0: GRAPHQL_NAME@225..233 "alive" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@225..233 + 0: IDENT@225..233 "alive" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@233..235 ":" [] [Whitespace(" ")] 2: GRAPHQL_BOOLEAN_VALUE@235..241 0: FALSE_KW@235..241 "false" [] [Skipped(",")] 4: GRAPHQL_ARGUMENT@241..258 - 0: GRAPHQL_NAME@241..252 - 0: GRAPHQL_NAME@241..252 "location" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@241..252 + 0: IDENT@241..252 "location" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@252..254 ":" [] [Whitespace(" ")] 2: GRAPHQL_NULL_VALUE@254..258 0: NULL_KW@254..258 "null" [] [] 5: GRAPHQL_ARGUMENT@258..320 - 0: GRAPHQL_NAME@258..271 - 0: GRAPHQL_NAME@258..271 "birthplace" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@258..271 + 0: IDENT@258..271 "birthplace" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@271..273 ":" [] [Whitespace(" ")] 2: GRAPHQL_OBJECT_VALUE@273..320 0: L_CURLY@273..274 "{" [] [] 1: GRAPHQL_OBJECT_VALUE_MEMBER_LIST@274..319 0: GRAPHQL_OBJECT_FIELD@274..292 - 0: GRAPHQL_NAME@274..278 - 0: GRAPHQL_NAME@274..278 "city" [] [] + 0: GRAPHQL_LITERAL_NAME@274..278 + 0: IDENT@274..278 "city" [] [] 1: COLON@278..280 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@280..292 0: GRAPHQL_STRING_LITERAL@280..292 "\"New York\"" [] [Skipped(","), Whitespace(" ")] 1: GRAPHQL_OBJECT_FIELD@292..305 - 0: GRAPHQL_NAME@292..297 - 0: GRAPHQL_NAME@292..297 "state" [] [] + 0: GRAPHQL_LITERAL_NAME@292..297 + 0: IDENT@292..297 "state" [] [] 1: COLON@297..299 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@299..305 0: GRAPHQL_STRING_LITERAL@299..305 "\"NY\"" [] [Skipped(","), Whitespace(" ")] 2: GRAPHQL_OBJECT_FIELD@305..319 - 0: GRAPHQL_NAME@305..312 - 0: GRAPHQL_NAME@305..312 "country" [] [] + 0: GRAPHQL_LITERAL_NAME@305..312 + 0: IDENT@305..312 "country" [] [] 1: COLON@312..314 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@314..319 0: GRAPHQL_STRING_LITERAL@314..319 "\"USA\"" [] [] 2: R_CURLY@319..320 "}" [] [] 6: GRAPHQL_ARGUMENT@320..352 - 0: GRAPHQL_NAME@320..330 - 0: GRAPHQL_NAME@320..330 "friends" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@320..330 + 0: IDENT@320..330 "friends" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@330..332 ":" [] [Whitespace(" ")] 2: GRAPHQL_LIST_VALUE@332..352 0: L_BRACK@332..333 "[" [] [] @@ -1203,52 +1201,52 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@357..441 0: GRAPHQL_FIELD@357..368 0: (empty) - 1: GRAPHQL_NAME@357..368 - 0: GRAPHQL_NAME@357..368 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@357..368 + 0: IDENT@357..368 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@368..368 4: (empty) 1: GRAPHQL_FIELD@368..376 0: (empty) - 1: GRAPHQL_NAME@368..376 - 0: GRAPHQL_NAME@368..376 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@368..376 + 0: IDENT@368..376 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@376..376 4: (empty) 2: GRAPHQL_FIELD@376..383 0: (empty) - 1: GRAPHQL_NAME@376..383 - 0: GRAPHQL_NAME@376..383 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@376..383 + 0: IDENT@376..383 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@383..383 4: (empty) 3: GRAPHQL_FIELD@383..405 0: (empty) - 1: GRAPHQL_NAME@383..392 - 0: GRAPHQL_NAME@383..392 "height" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@383..392 + 0: IDENT@383..392 "height" [Newline("\n"), Whitespace("\t\t")] [] 2: GRAPHQL_ARGUMENTS@392..405 0: L_PAREN@392..393 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@393..403 0: GRAPHQL_ARGUMENT@393..403 - 0: GRAPHQL_NAME@393..397 - 0: GRAPHQL_NAME@393..397 "unit" [] [] + 0: GRAPHQL_LITERAL_NAME@393..397 + 0: IDENT@393..397 "unit" [] [] 1: COLON@397..399 ":" [] [Whitespace(" ")] 2: GRAPHQL_ENUM_VALUE@399..403 - 0: GRAPHQL_NAME@399..403 - 0: GRAPHQL_NAME@399..403 "FOOT" [] [] + 0: GRAPHQL_LITERAL_NAME@399..403 + 0: IDENT@399..403 "FOOT" [] [] 2: R_PAREN@403..405 ")" [] [Skipped(",")] 3: GRAPHQL_DIRECTIVE_LIST@405..405 4: (empty) 4: GRAPHQL_FIELD@405..441 0: (empty) - 1: GRAPHQL_NAME@405..412 - 0: GRAPHQL_NAME@405..412 "wife" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@405..412 + 0: IDENT@405..412 "wife" [Newline("\n"), Whitespace("\t\t")] [] 2: GRAPHQL_ARGUMENTS@412..428 0: L_PAREN@412..413 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@413..427 0: GRAPHQL_ARGUMENT@413..427 - 0: GRAPHQL_NAME@413..417 - 0: GRAPHQL_NAME@413..417 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@413..417 + 0: IDENT@413..417 "name" [] [] 1: COLON@417..419 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@419..427 0: GRAPHQL_STRING_LITERAL@419..427 "\"Pepper\"" [] [] @@ -1259,8 +1257,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@429..437 0: GRAPHQL_FIELD@429..437 0: (empty) - 1: GRAPHQL_NAME@429..437 - 0: GRAPHQL_NAME@429..437 "name" [Newline("\n"), Whitespace("\t\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@429..437 + 0: IDENT@429..437 "name" [Newline("\n"), Whitespace("\t\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@437..437 4: (empty) @@ -1272,19 +1270,19 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@449..468 0: GRAPHQL_FIELD@449..468 0: (empty) - 1: GRAPHQL_NAME@449..455 - 0: GRAPHQL_NAME@449..455 "hero" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@449..455 + 0: IDENT@449..455 "hero" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@455..468 0: L_PAREN@455..456 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@456..467 0: GRAPHQL_ARGUMENT@456..467 - 0: GRAPHQL_NAME@456..460 - 0: GRAPHQL_NAME@456..460 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@456..460 + 0: IDENT@456..460 "name" [] [] 1: COLON@460..462 ":" [] [Whitespace(" ")] - 2: GRAPHQL_VARIABLE@462..467 + 2: GRAPHQL_VARIABLE_REFERENCE@462..467 0: DOLLAR@462..463 "$" [] [] - 1: GRAPHQL_NAME@463..467 - 0: GRAPHQL_NAME@463..467 "name" [] [] + 1: GRAPHQL_LITERAL_NAME@463..467 + 0: IDENT@463..467 "name" [] [] 2: R_PAREN@467..468 ")" [] [] 3: GRAPHQL_DIRECTIVE_LIST@468..468 4: (empty) @@ -1294,17 +1292,17 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@488..524 0: GRAPHQL_FIELD@488..524 0: GRAPHQL_ALIAS@488..500 - 0: GRAPHQL_NAME@488..498 - 0: GRAPHQL_NAME@488..498 "ironMan" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@488..498 + 0: IDENT@488..498 "ironMan" [Newline("\n"), Whitespace(" ")] [] 1: COLON@498..500 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@500..504 - 0: GRAPHQL_NAME@500..504 "hero" [] [] + 1: GRAPHQL_LITERAL_NAME@500..504 + 0: IDENT@500..504 "hero" [] [] 2: GRAPHQL_ARGUMENTS@504..524 0: L_PAREN@504..505 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@505..523 0: GRAPHQL_ARGUMENT@505..523 - 0: GRAPHQL_NAME@505..509 - 0: GRAPHQL_NAME@505..509 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@505..509 + 0: IDENT@505..509 "name" [] [] 1: COLON@509..511 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@511..523 0: GRAPHQL_STRING_LITERAL@511..523 "\"Tony Stark\"" [] [] @@ -1317,17 +1315,17 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@529..643 0: GRAPHQL_FIELD@529..643 0: GRAPHQL_ALIAS@529..541 - 0: GRAPHQL_NAME@529..539 - 0: GRAPHQL_NAME@529..539 "ironMan" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@529..539 + 0: IDENT@529..539 "ironMan" [Newline("\n"), Whitespace(" ")] [] 1: COLON@539..541 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@541..545 - 0: GRAPHQL_NAME@541..545 "hero" [] [] + 1: GRAPHQL_LITERAL_NAME@541..545 + 0: IDENT@541..545 "hero" [] [] 2: GRAPHQL_ARGUMENTS@545..566 0: L_PAREN@545..546 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@546..564 0: GRAPHQL_ARGUMENT@546..564 - 0: GRAPHQL_NAME@546..550 - 0: GRAPHQL_NAME@546..550 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@546..550 + 0: IDENT@546..550 "name" [] [] 1: COLON@550..552 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@552..564 0: GRAPHQL_STRING_LITERAL@552..564 "\"Tony Stark\"" [] [] @@ -1338,38 +1336,38 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@567..640 0: GRAPHQL_FIELD@567..578 0: (empty) - 1: GRAPHQL_NAME@567..578 - 0: GRAPHQL_NAME@567..578 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@567..578 + 0: IDENT@567..578 "country" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@578..578 4: (empty) 1: GRAPHQL_FIELD@578..586 0: (empty) - 1: GRAPHQL_NAME@578..586 - 0: GRAPHQL_NAME@578..586 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@578..586 + 0: IDENT@578..586 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@586..586 4: (empty) 2: GRAPHQL_FIELD@586..593 0: (empty) - 1: GRAPHQL_NAME@586..593 - 0: GRAPHQL_NAME@586..593 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@586..593 + 0: IDENT@586..593 "age" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@593..593 4: (empty) 3: GRAPHQL_FIELD@593..640 0: GRAPHQL_ALIAS@593..607 - 0: GRAPHQL_NAME@593..605 - 0: GRAPHQL_NAME@593..605 "firstWife" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@593..605 + 0: IDENT@593..605 "firstWife" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@605..607 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@607..611 - 0: GRAPHQL_NAME@607..611 "wife" [] [] + 1: GRAPHQL_LITERAL_NAME@607..611 + 0: IDENT@607..611 "wife" [] [] 2: GRAPHQL_ARGUMENTS@611..627 0: L_PAREN@611..612 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@612..626 0: GRAPHQL_ARGUMENT@612..626 - 0: GRAPHQL_NAME@612..616 - 0: GRAPHQL_NAME@612..616 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@612..616 + 0: IDENT@612..616 "name" [] [] 1: COLON@616..618 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@618..626 0: GRAPHQL_STRING_LITERAL@618..626 "\"Pepper\"" [] [] @@ -1380,8 +1378,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@628..636 0: GRAPHQL_FIELD@628..636 0: (empty) - 1: GRAPHQL_NAME@628..636 - 0: GRAPHQL_NAME@628..636 "name" [Newline("\n"), Whitespace("\t\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@628..636 + 0: IDENT@628..636 "name" [Newline("\n"), Whitespace("\t\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@636..636 4: (empty) @@ -1393,14 +1391,14 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@666..685 0: GRAPHQL_FIELD@666..685 0: (empty) - 1: GRAPHQL_NAME@666..674 - 0: GRAPHQL_NAME@666..674 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@666..674 + 0: IDENT@666..674 "hero" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@674..685 0: GRAPHQL_DIRECTIVE@674..685 0: AT@674..675 "@" [] [] - 1: GRAPHQL_NAME@675..685 - 0: GRAPHQL_NAME@675..685 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@675..685 + 0: IDENT@675..685 "deprecated" [] [] 2: (empty) 4: (empty) 2: R_CURLY@685..687 "}" [Newline("\n")] [] @@ -1409,17 +1407,17 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@690..780 0: GRAPHQL_FIELD@690..780 0: GRAPHQL_ALIAS@690..702 - 0: GRAPHQL_NAME@690..700 - 0: GRAPHQL_NAME@690..700 "ironMan" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@690..700 + 0: IDENT@690..700 "ironMan" [Newline("\n"), Whitespace(" ")] [] 1: COLON@700..702 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@702..706 - 0: GRAPHQL_NAME@702..706 "hero" [] [] + 1: GRAPHQL_LITERAL_NAME@702..706 + 0: IDENT@702..706 "hero" [] [] 2: GRAPHQL_ARGUMENTS@706..727 0: L_PAREN@706..707 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@707..725 0: GRAPHQL_ARGUMENT@707..725 - 0: GRAPHQL_NAME@707..711 - 0: GRAPHQL_NAME@707..711 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@707..711 + 0: IDENT@707..711 "name" [] [] 1: COLON@711..713 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@713..725 0: GRAPHQL_STRING_LITERAL@713..725 "\"Tony Stark\"" [] [] @@ -1427,35 +1425,35 @@ GraphqlRoot { 3: GRAPHQL_DIRECTIVE_LIST@727..739 0: GRAPHQL_DIRECTIVE@727..739 0: AT@727..728 "@" [] [] - 1: GRAPHQL_NAME@728..739 - 0: GRAPHQL_NAME@728..739 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@728..739 + 0: IDENT@728..739 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_SELECTION_SET@739..780 0: L_CURLY@739..740 "{" [] [] 1: GRAPHQL_SELECTION_LIST@740..777 0: GRAPHQL_FIELD@740..763 0: (empty) - 1: GRAPHQL_NAME@740..751 - 0: GRAPHQL_NAME@740..751 "country" [Newline("\n"), Whitespace("\t\t")] [Whitespace(" ")] + 1: GRAPHQL_LITERAL_NAME@740..751 + 0: IDENT@740..751 "country" [Newline("\n"), Whitespace("\t\t")] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@751..763 0: GRAPHQL_DIRECTIVE@751..763 0: AT@751..752 "@" [] [] - 1: GRAPHQL_NAME@752..763 - 0: GRAPHQL_NAME@752..763 "deprecated" [] [Skipped(",")] + 1: GRAPHQL_NAME_REFERENCE@752..763 + 0: IDENT@752..763 "deprecated" [] [Skipped(",")] 2: (empty) 4: (empty) 1: GRAPHQL_FIELD@763..771 0: (empty) - 1: GRAPHQL_NAME@763..771 - 0: GRAPHQL_NAME@763..771 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@763..771 + 0: IDENT@763..771 "name" [Newline("\n"), Whitespace("\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@771..771 4: (empty) 2: GRAPHQL_FIELD@771..777 0: (empty) - 1: GRAPHQL_NAME@771..777 - 0: GRAPHQL_NAME@771..777 "age" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@771..777 + 0: IDENT@771..777 "age" [Newline("\n"), Whitespace("\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@777..777 4: (empty) @@ -1466,8 +1464,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@803..821 0: GRAPHQL_FRAGMENT_SPREAD@803..821 0: DOT3@803..809 "..." [Newline("\n"), Whitespace(" ")] [] - 1: GRAPHQL_NAME@809..821 - 0: GRAPHQL_NAME@809..821 "heroFragment" [] [] + 1: GRAPHQL_NAME_REFERENCE@809..821 + 0: IDENT@809..821 "heroFragment" [] [] 2: GRAPHQL_DIRECTIVE_LIST@821..821 2: R_CURLY@821..823 "}" [Newline("\n")] [] 11: GRAPHQL_SELECTION_SET@823..858 @@ -1475,13 +1473,13 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@826..856 0: GRAPHQL_FRAGMENT_SPREAD@826..856 0: DOT3@826..832 "..." [Newline("\n"), Whitespace(" ")] [] - 1: GRAPHQL_NAME@832..845 - 0: GRAPHQL_NAME@832..845 "heroFragment" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@832..845 + 0: IDENT@832..845 "heroFragment" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@845..856 0: GRAPHQL_DIRECTIVE@845..856 0: AT@845..846 "@" [] [] - 1: GRAPHQL_NAME@846..856 - 0: GRAPHQL_NAME@846..856 "deprecated" [] [] + 1: GRAPHQL_NAME_REFERENCE@846..856 + 0: IDENT@846..856 "deprecated" [] [] 2: (empty) 2: R_CURLY@856..858 "}" [Newline("\n")] [] 12: GRAPHQL_SELECTION_SET@858..936 @@ -1489,17 +1487,17 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@861..934 0: GRAPHQL_FIELD@861..934 0: GRAPHQL_ALIAS@861..873 - 0: GRAPHQL_NAME@861..871 - 0: GRAPHQL_NAME@861..871 "ironMan" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@861..871 + 0: IDENT@861..871 "ironMan" [Newline("\n"), Whitespace(" ")] [] 1: COLON@871..873 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@873..877 - 0: GRAPHQL_NAME@873..877 "hero" [] [] + 1: GRAPHQL_LITERAL_NAME@873..877 + 0: IDENT@873..877 "hero" [] [] 2: GRAPHQL_ARGUMENTS@877..898 0: L_PAREN@877..878 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@878..896 0: GRAPHQL_ARGUMENT@878..896 - 0: GRAPHQL_NAME@878..882 - 0: GRAPHQL_NAME@878..882 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@878..882 + 0: IDENT@878..882 "name" [] [] 1: COLON@882..884 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@884..896 0: GRAPHQL_STRING_LITERAL@884..896 "\"Tony Stark\"" [] [] @@ -1507,16 +1505,16 @@ GraphqlRoot { 3: GRAPHQL_DIRECTIVE_LIST@898..910 0: GRAPHQL_DIRECTIVE@898..910 0: AT@898..899 "@" [] [] - 1: GRAPHQL_NAME@899..910 - 0: GRAPHQL_NAME@899..910 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@899..910 + 0: IDENT@899..910 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_SELECTION_SET@910..934 0: L_CURLY@910..911 "{" [] [] 1: GRAPHQL_SELECTION_LIST@911..931 0: GRAPHQL_FRAGMENT_SPREAD@911..931 0: DOT3@911..917 "..." [Newline("\n"), Whitespace("\t\t")] [] - 1: GRAPHQL_NAME@917..931 - 0: GRAPHQL_NAME@917..931 "heroAttributes" [] [] + 1: GRAPHQL_NAME_REFERENCE@917..931 + 0: IDENT@917..931 "heroAttributes" [] [] 2: GRAPHQL_DIRECTIVE_LIST@931..931 2: R_CURLY@931..934 "}" [Newline("\n"), Whitespace("\t")] [] 2: R_CURLY@934..936 "}" [Newline("\n")] [] @@ -1532,8 +1530,8 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@972..979 0: GRAPHQL_FIELD@972..979 0: (empty) - 1: GRAPHQL_NAME@972..979 - 0: GRAPHQL_NAME@972..979 "hero" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@972..979 + 0: IDENT@972..979 "hero" [Newline("\n"), Whitespace("\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@979..979 4: (empty) @@ -1548,16 +1546,16 @@ GraphqlRoot { 2: GRAPHQL_DIRECTIVE_LIST@994..1006 0: GRAPHQL_DIRECTIVE@994..1006 0: AT@994..995 "@" [] [] - 1: GRAPHQL_NAME@995..1006 - 0: GRAPHQL_NAME@995..1006 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@995..1006 + 0: IDENT@995..1006 "deprecated" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_SELECTION_SET@1006..1017 0: L_CURLY@1006..1007 "{" [] [] 1: GRAPHQL_SELECTION_LIST@1007..1014 0: GRAPHQL_FIELD@1007..1014 0: (empty) - 1: GRAPHQL_NAME@1007..1014 - 0: GRAPHQL_NAME@1007..1014 "hero" [Newline("\n"), Whitespace("\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@1007..1014 + 0: IDENT@1007..1014 "hero" [Newline("\n"), Whitespace("\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@1014..1014 4: (empty) @@ -1568,17 +1566,17 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@1022..1123 0: GRAPHQL_FIELD@1022..1123 0: GRAPHQL_ALIAS@1022..1034 - 0: GRAPHQL_NAME@1022..1032 - 0: GRAPHQL_NAME@1022..1032 "ironMan" [Newline("\n"), Whitespace(" ")] [] + 0: GRAPHQL_LITERAL_NAME@1022..1032 + 0: IDENT@1022..1032 "ironMan" [Newline("\n"), Whitespace(" ")] [] 1: COLON@1032..1034 ":" [] [Whitespace(" ")] - 1: GRAPHQL_NAME@1034..1038 - 0: GRAPHQL_NAME@1034..1038 "hero" [] [] + 1: GRAPHQL_LITERAL_NAME@1034..1038 + 0: IDENT@1034..1038 "hero" [] [] 2: GRAPHQL_ARGUMENTS@1038..1059 0: L_PAREN@1038..1039 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@1039..1057 0: GRAPHQL_ARGUMENT@1039..1057 - 0: GRAPHQL_NAME@1039..1043 - 0: GRAPHQL_NAME@1039..1043 "name" [] [] + 0: GRAPHQL_LITERAL_NAME@1039..1043 + 0: IDENT@1039..1043 "name" [] [] 1: COLON@1043..1045 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@1045..1057 0: GRAPHQL_STRING_LITERAL@1045..1057 "\"Tony Stark\"" [] [] @@ -1586,8 +1584,8 @@ GraphqlRoot { 3: GRAPHQL_DIRECTIVE_LIST@1059..1071 0: GRAPHQL_DIRECTIVE@1059..1071 0: AT@1059..1060 "@" [] [] - 1: GRAPHQL_NAME@1060..1071 - 0: GRAPHQL_NAME@1060..1071 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@1060..1071 + 0: IDENT@1060..1071 "deprecated" [] [Whitespace(" ")] 2: (empty) 4: GRAPHQL_SELECTION_SET@1071..1123 0: L_CURLY@1071..1072 "{" [] [] @@ -1596,29 +1594,28 @@ GraphqlRoot { 0: DOT3@1072..1079 "..." [Newline("\n"), Whitespace("\t\t")] [Whitespace(" ")] 1: GRAPHQL_TYPE_CONDITION@1079..1087 0: ON_KW@1079..1082 "on" [] [Whitespace(" ")] - 1: GRAPHQL_NAMED_TYPE@1082..1087 - 0: GRAPHQL_NAME@1082..1087 - 0: GRAPHQL_NAME@1082..1087 "Hero" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@1082..1087 + 0: IDENT@1082..1087 "Hero" [] [Whitespace(" ")] 2: GRAPHQL_DIRECTIVE_LIST@1087..1099 0: GRAPHQL_DIRECTIVE@1087..1099 0: AT@1087..1088 "@" [] [] - 1: GRAPHQL_NAME@1088..1099 - 0: GRAPHQL_NAME@1088..1099 "deprecated" [] [Whitespace(" ")] + 1: GRAPHQL_NAME_REFERENCE@1088..1099 + 0: IDENT@1088..1099 "deprecated" [] [Whitespace(" ")] 2: (empty) 3: GRAPHQL_SELECTION_SET@1099..1120 0: L_CURLY@1099..1100 "{" [] [] 1: GRAPHQL_SELECTION_LIST@1100..1116 0: GRAPHQL_FIELD@1100..1109 0: (empty) - 1: GRAPHQL_NAME@1100..1109 - 0: GRAPHQL_NAME@1100..1109 "name" [Newline("\n"), Whitespace("\t\t\t")] [Skipped(",")] + 1: GRAPHQL_LITERAL_NAME@1100..1109 + 0: IDENT@1100..1109 "name" [Newline("\n"), Whitespace("\t\t\t")] [Skipped(",")] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@1109..1109 4: (empty) 1: GRAPHQL_FIELD@1109..1116 0: (empty) - 1: GRAPHQL_NAME@1109..1116 - 0: GRAPHQL_NAME@1109..1116 "age" [Newline("\n"), Whitespace("\t\t\t")] [] + 1: GRAPHQL_LITERAL_NAME@1109..1116 + 0: IDENT@1109..1116 "age" [Newline("\n"), Whitespace("\t\t\t")] [] 2: (empty) 3: GRAPHQL_DIRECTIVE_LIST@1116..1116 4: (empty) diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/type.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/type.graphql.snap index 992b5c01d9fc..8a2acb78e615 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/type.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/type.graphql.snap @@ -26,18 +26,16 @@ GraphqlRoot { l_paren_token: L_PAREN@6..7 "(" [] [], elements: GraphqlVariableDefinitionList [ GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@7..8 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@8..15 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@8..15 "storyId" [] [], }, }, colon_token: COLON@15..17 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@17..19 "ID" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@17..19 "ID" [] [], }, excl_token: BANG@19..22 "!" [] [Skipped(","), Whitespace(" ")], }, @@ -45,36 +43,32 @@ GraphqlRoot { directives: GraphqlDirectiveList [], }, GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@22..23 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@23..27 "like" [] [], + name: GraphqlLiteralName { + value_token: IDENT@23..27 "like" [] [], }, }, colon_token: COLON@27..29 ":" [] [Whitespace(" ")], - ty: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@29..38 "Boolean" [] [Skipped(","), Whitespace(" ")], - }, + ty: GraphqlNameReference { + value_token: IDENT@29..38 "Boolean" [] [Skipped(","), Whitespace(" ")], }, default: missing (optional), directives: GraphqlDirectiveList [], }, GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@38..39 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@39..47 "comments" [] [], + name: GraphqlLiteralName { + value_token: IDENT@39..47 "comments" [] [], }, }, colon_token: COLON@47..49 ":" [] [Whitespace(" ")], ty: GraphqlListType { l_brack_token: L_BRACK@49..50 "[" [] [], element: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@50..56 "String" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@50..56 "String" [] [], }, excl_token: BANG@56..57 "!" [] [], }, @@ -84,10 +78,10 @@ GraphqlRoot { directives: GraphqlDirectiveList [], }, GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@60..61 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@61..65 "tags" [] [], + name: GraphqlLiteralName { + value_token: IDENT@61..65 "tags" [] [], }, }, colon_token: COLON@65..67 ":" [] [Whitespace(" ")], @@ -95,10 +89,8 @@ GraphqlRoot { base: GraphqlListType { l_brack_token: L_BRACK@67..68 "[" [] [], element: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@68..74 "String" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@68..74 "String" [] [], }, excl_token: BANG@74..75 "!" [] [], }, @@ -110,20 +102,18 @@ GraphqlRoot { directives: GraphqlDirectiveList [], }, GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@79..80 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@80..85 "posts" [] [], + name: GraphqlLiteralName { + value_token: IDENT@80..85 "posts" [] [], }, }, colon_token: COLON@85..87 ":" [] [Whitespace(" ")], ty: GraphqlNonNullType { base: GraphqlListType { l_brack_token: L_BRACK@87..88 "[" [] [], - element: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@88..97 "PostInput" [] [], - }, + element: GraphqlNameReference { + value_token: IDENT@88..97 "PostInput" [] [], }, r_brack_token: R_BRACK@97..98 "]" [] [], }, @@ -133,10 +123,10 @@ GraphqlRoot { directives: GraphqlDirectiveList [], }, GraphqlVariableDefinition { - variable: GraphqlVariable { + variable: GraphqlVariableBinding { dollar_token: DOLLAR@101..102 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@102..107 "input" [] [], + name: GraphqlLiteralName { + value_token: IDENT@102..107 "input" [] [], }, }, colon_token: COLON@107..109 ":" [] [Whitespace(" ")], @@ -144,10 +134,8 @@ GraphqlRoot { base: GraphqlListType { l_brack_token: L_BRACK@109..110 "[" [] [], element: GraphqlNonNullType { - base: GraphqlNamedType { - name: GraphqlName { - value_token: GRAPHQL_NAME@110..115 "input" [] [], - }, + base: GraphqlNameReference { + value_token: IDENT@110..115 "input" [] [], }, excl_token: BANG@115..116 "!" [] [], }, @@ -167,21 +155,21 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@121..132 "likeStory" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@121..132 "likeStory" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@132..133 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@133..140 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@133..140 "storyId" [] [], }, colon_token: COLON@140..142 ":" [] [Whitespace(" ")], - value: GraphqlVariable { + value: GraphqlVariableReference { dollar_token: DOLLAR@142..143 "$" [] [], - name: GraphqlName { - value_token: GRAPHQL_NAME@143..150 "storyId" [] [], + name: GraphqlLiteralName { + value_token: IDENT@143..150 "storyId" [] [], }, }, }, @@ -214,92 +202,86 @@ GraphqlRoot { 0: L_PAREN@6..7 "(" [] [] 1: GRAPHQL_VARIABLE_DEFINITION_LIST@7..118 0: GRAPHQL_VARIABLE_DEFINITION@7..22 - 0: GRAPHQL_VARIABLE@7..15 + 0: GRAPHQL_VARIABLE_BINDING@7..15 0: DOLLAR@7..8 "$" [] [] - 1: GRAPHQL_NAME@8..15 - 0: GRAPHQL_NAME@8..15 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@8..15 + 0: IDENT@8..15 "storyId" [] [] 1: COLON@15..17 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@17..22 - 0: GRAPHQL_NAMED_TYPE@17..19 - 0: GRAPHQL_NAME@17..19 - 0: GRAPHQL_NAME@17..19 "ID" [] [] + 0: GRAPHQL_NAME_REFERENCE@17..19 + 0: IDENT@17..19 "ID" [] [] 1: BANG@19..22 "!" [] [Skipped(","), Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@22..22 1: GRAPHQL_VARIABLE_DEFINITION@22..38 - 0: GRAPHQL_VARIABLE@22..27 + 0: GRAPHQL_VARIABLE_BINDING@22..27 0: DOLLAR@22..23 "$" [] [] - 1: GRAPHQL_NAME@23..27 - 0: GRAPHQL_NAME@23..27 "like" [] [] + 1: GRAPHQL_LITERAL_NAME@23..27 + 0: IDENT@23..27 "like" [] [] 1: COLON@27..29 ":" [] [Whitespace(" ")] - 2: GRAPHQL_NAMED_TYPE@29..38 - 0: GRAPHQL_NAME@29..38 - 0: GRAPHQL_NAME@29..38 "Boolean" [] [Skipped(","), Whitespace(" ")] + 2: GRAPHQL_NAME_REFERENCE@29..38 + 0: IDENT@29..38 "Boolean" [] [Skipped(","), Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@38..38 2: GRAPHQL_VARIABLE_DEFINITION@38..60 - 0: GRAPHQL_VARIABLE@38..47 + 0: GRAPHQL_VARIABLE_BINDING@38..47 0: DOLLAR@38..39 "$" [] [] - 1: GRAPHQL_NAME@39..47 - 0: GRAPHQL_NAME@39..47 "comments" [] [] + 1: GRAPHQL_LITERAL_NAME@39..47 + 0: IDENT@39..47 "comments" [] [] 1: COLON@47..49 ":" [] [Whitespace(" ")] 2: GRAPHQL_LIST_TYPE@49..60 0: L_BRACK@49..50 "[" [] [] 1: GRAPHQL_NON_NULL_TYPE@50..57 - 0: GRAPHQL_NAMED_TYPE@50..56 - 0: GRAPHQL_NAME@50..56 - 0: GRAPHQL_NAME@50..56 "String" [] [] + 0: GRAPHQL_NAME_REFERENCE@50..56 + 0: IDENT@50..56 "String" [] [] 1: BANG@56..57 "!" [] [] 2: R_BRACK@57..60 "]" [] [Skipped(","), Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@60..60 3: GRAPHQL_VARIABLE_DEFINITION@60..79 - 0: GRAPHQL_VARIABLE@60..65 + 0: GRAPHQL_VARIABLE_BINDING@60..65 0: DOLLAR@60..61 "$" [] [] - 1: GRAPHQL_NAME@61..65 - 0: GRAPHQL_NAME@61..65 "tags" [] [] + 1: GRAPHQL_LITERAL_NAME@61..65 + 0: IDENT@61..65 "tags" [] [] 1: COLON@65..67 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@67..79 0: GRAPHQL_LIST_TYPE@67..76 0: L_BRACK@67..68 "[" [] [] 1: GRAPHQL_NON_NULL_TYPE@68..75 - 0: GRAPHQL_NAMED_TYPE@68..74 - 0: GRAPHQL_NAME@68..74 - 0: GRAPHQL_NAME@68..74 "String" [] [] + 0: GRAPHQL_NAME_REFERENCE@68..74 + 0: IDENT@68..74 "String" [] [] 1: BANG@74..75 "!" [] [] 2: R_BRACK@75..76 "]" [] [] 1: BANG@76..79 "!" [] [Skipped(","), Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@79..79 4: GRAPHQL_VARIABLE_DEFINITION@79..101 - 0: GRAPHQL_VARIABLE@79..85 + 0: GRAPHQL_VARIABLE_BINDING@79..85 0: DOLLAR@79..80 "$" [] [] - 1: GRAPHQL_NAME@80..85 - 0: GRAPHQL_NAME@80..85 "posts" [] [] + 1: GRAPHQL_LITERAL_NAME@80..85 + 0: IDENT@80..85 "posts" [] [] 1: COLON@85..87 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@87..101 0: GRAPHQL_LIST_TYPE@87..98 0: L_BRACK@87..88 "[" [] [] - 1: GRAPHQL_NAMED_TYPE@88..97 - 0: GRAPHQL_NAME@88..97 - 0: GRAPHQL_NAME@88..97 "PostInput" [] [] + 1: GRAPHQL_NAME_REFERENCE@88..97 + 0: IDENT@88..97 "PostInput" [] [] 2: R_BRACK@97..98 "]" [] [] 1: BANG@98..101 "!" [] [Skipped(","), Whitespace(" ")] 3: (empty) 4: GRAPHQL_DIRECTIVE_LIST@101..101 5: GRAPHQL_VARIABLE_DEFINITION@101..118 - 0: GRAPHQL_VARIABLE@101..107 + 0: GRAPHQL_VARIABLE_BINDING@101..107 0: DOLLAR@101..102 "$" [] [] - 1: GRAPHQL_NAME@102..107 - 0: GRAPHQL_NAME@102..107 "input" [] [] + 1: GRAPHQL_LITERAL_NAME@102..107 + 0: IDENT@102..107 "input" [] [] 1: COLON@107..109 ":" [] [Whitespace(" ")] 2: GRAPHQL_NON_NULL_TYPE@109..118 0: GRAPHQL_LIST_TYPE@109..117 0: L_BRACK@109..110 "[" [] [] 1: GRAPHQL_NON_NULL_TYPE@110..116 - 0: GRAPHQL_NAMED_TYPE@110..115 - 0: GRAPHQL_NAME@110..115 - 0: GRAPHQL_NAME@110..115 "input" [] [] + 0: GRAPHQL_NAME_REFERENCE@110..115 + 0: IDENT@110..115 "input" [] [] 1: BANG@115..116 "!" [] [] 2: R_BRACK@116..117 "]" [] [] 1: BANG@117..118 "!" [] [] @@ -312,19 +294,19 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@121..151 0: GRAPHQL_FIELD@121..151 0: (empty) - 1: GRAPHQL_NAME@121..132 - 0: GRAPHQL_NAME@121..132 "likeStory" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@121..132 + 0: IDENT@121..132 "likeStory" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@132..151 0: L_PAREN@132..133 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@133..150 0: GRAPHQL_ARGUMENT@133..150 - 0: GRAPHQL_NAME@133..140 - 0: GRAPHQL_NAME@133..140 "storyId" [] [] + 0: GRAPHQL_LITERAL_NAME@133..140 + 0: IDENT@133..140 "storyId" [] [] 1: COLON@140..142 ":" [] [Whitespace(" ")] - 2: GRAPHQL_VARIABLE@142..150 + 2: GRAPHQL_VARIABLE_REFERENCE@142..150 0: DOLLAR@142..143 "$" [] [] - 1: GRAPHQL_NAME@143..150 - 0: GRAPHQL_NAME@143..150 "storyId" [] [] + 1: GRAPHQL_LITERAL_NAME@143..150 + 0: IDENT@143..150 "storyId" [] [] 2: R_PAREN@150..151 ")" [] [] 3: GRAPHQL_DIRECTIVE_LIST@151..151 4: (empty) diff --git a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/value.graphql.snap b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/value.graphql.snap index cf186eb2d131..f21366ff6a18 100644 --- a/crates/biome_graphql_parser/tests/graphql_test_suite/ok/value.graphql.snap +++ b/crates/biome_graphql_parser/tests/graphql_test_suite/ok/value.graphql.snap @@ -33,15 +33,15 @@ GraphqlRoot { selections: GraphqlSelectionList [ GraphqlField { alias: missing (optional), - name: GraphqlName { - value_token: GRAPHQL_NAME@1..14 "field_value" [Newline("\n"), Whitespace("\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@1..14 "field_value" [Newline("\n"), Whitespace("\t")] [], }, arguments: GraphqlArguments { l_paren_token: L_PAREN@14..15 "(" [] [], arguments: GraphqlArgumentList [ GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@15..27 "int_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@15..27 "int_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@27..29 ":" [] [Whitespace(" ")], value: GraphqlIntValue { @@ -49,8 +49,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@31..45 "float_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@31..45 "float_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@45..47 ":" [] [Whitespace(" ")], value: GraphqlFloatValue { @@ -58,8 +58,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@51..66 "string_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@51..66 "string_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@66..68 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -67,8 +67,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@77..93 "boolean_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@77..93 "boolean_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@93..95 ":" [] [Whitespace(" ")], value: GraphqlBooleanValue { @@ -76,8 +76,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@100..113 "null_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@100..113 "null_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@113..115 ":" [] [Whitespace(" ")], value: GraphqlNullValue { @@ -85,41 +85,41 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@120..133 "enum_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@120..133 "enum_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@133..135 ":" [] [Whitespace(" ")], value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@135..146 "ENUM_VALUE" [] [Skipped(",")], + value: GraphqlLiteralName { + value_token: IDENT@135..146 "ENUM_VALUE" [] [Skipped(",")], }, }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@146..159 "enum_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@146..159 "enum_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@159..161 ":" [] [Whitespace(" ")], value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@161..166 "enum" [] [Skipped(",")], + value: GraphqlLiteralName { + value_token: IDENT@161..166 "enum" [] [Skipped(",")], }, }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@166..179 "enum_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@166..179 "enum_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@179..181 ":" [] [Whitespace(" ")], value: GraphqlEnumValue { - graphql_name: GraphqlName { - value_token: GRAPHQL_NAME@181..184 "on" [] [Skipped(",")], + value: GraphqlLiteralName { + value_token: IDENT@181..184 "on" [] [Skipped(",")], }, }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@184..197 "list_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@184..197 "list_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@197..199 ":" [] [Whitespace(" ")], value: GraphqlListValue { @@ -139,16 +139,16 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@209..224 "object_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@209..224 "object_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@224..226 ":" [] [Whitespace(" ")], value: GraphqlObjectValue { l_curly_token: L_CURLY@226..227 "{" [] [], members: GraphqlObjectValueMemberList [ GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@227..230 "key" [] [], + name: GraphqlLiteralName { + value_token: IDENT@227..230 "key" [] [], }, colon_token: COLON@230..232 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -160,8 +160,8 @@ GraphqlRoot { }, }, GraphqlArgument { - name: GraphqlName { - value_token: GRAPHQL_NAME@240..260 "list_object_value" [Newline("\n"), Whitespace("\t\t")] [], + name: GraphqlLiteralName { + value_token: IDENT@240..260 "list_object_value" [Newline("\n"), Whitespace("\t\t")] [], }, colon_token: COLON@260..262 ":" [] [Whitespace(" ")], value: GraphqlListValue { @@ -171,8 +171,8 @@ GraphqlRoot { l_curly_token: L_CURLY@263..264 "{" [] [], members: GraphqlObjectValueMemberList [ GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@264..267 "key" [] [], + name: GraphqlLiteralName { + value_token: IDENT@264..267 "key" [] [], }, colon_token: COLON@267..269 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -186,8 +186,8 @@ GraphqlRoot { l_curly_token: L_CURLY@279..280 "{" [] [], members: GraphqlObjectValueMemberList [ GraphqlObjectField { - name: GraphqlName { - value_token: GRAPHQL_NAME@280..283 "key" [] [], + name: GraphqlLiteralName { + value_token: IDENT@280..283 "key" [] [], }, colon_token: COLON@283..285 ":" [] [Whitespace(" ")], value: GraphqlStringValue { @@ -226,65 +226,65 @@ GraphqlRoot { 1: GRAPHQL_SELECTION_LIST@1..297 0: GRAPHQL_FIELD@1..297 0: (empty) - 1: GRAPHQL_NAME@1..14 - 0: GRAPHQL_NAME@1..14 "field_value" [Newline("\n"), Whitespace("\t")] [] + 1: GRAPHQL_LITERAL_NAME@1..14 + 0: IDENT@1..14 "field_value" [Newline("\n"), Whitespace("\t")] [] 2: GRAPHQL_ARGUMENTS@14..297 0: L_PAREN@14..15 "(" [] [] 1: GRAPHQL_ARGUMENT_LIST@15..294 0: GRAPHQL_ARGUMENT@15..31 - 0: GRAPHQL_NAME@15..27 - 0: GRAPHQL_NAME@15..27 "int_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@15..27 + 0: IDENT@15..27 "int_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@27..29 ":" [] [Whitespace(" ")] 2: GRAPHQL_INT_VALUE@29..31 0: GRAPHQL_INT_LITERAL@29..31 "1" [] [Skipped(",")] 1: GRAPHQL_ARGUMENT@31..51 - 0: GRAPHQL_NAME@31..45 - 0: GRAPHQL_NAME@31..45 "float_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@31..45 + 0: IDENT@31..45 "float_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@45..47 ":" [] [Whitespace(" ")] 2: GRAPHQL_FLOAT_VALUE@47..51 0: GRAPHQL_FLOAT_LITERAL@47..51 "1.1" [] [Skipped(",")] 2: GRAPHQL_ARGUMENT@51..77 - 0: GRAPHQL_NAME@51..66 - 0: GRAPHQL_NAME@51..66 "string_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@51..66 + 0: IDENT@51..66 "string_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@66..68 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@68..77 0: GRAPHQL_STRING_LITERAL@68..77 "\"string\"" [] [Skipped(",")] 3: GRAPHQL_ARGUMENT@77..100 - 0: GRAPHQL_NAME@77..93 - 0: GRAPHQL_NAME@77..93 "boolean_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@77..93 + 0: IDENT@77..93 "boolean_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@93..95 ":" [] [Whitespace(" ")] 2: GRAPHQL_BOOLEAN_VALUE@95..100 0: TRUE_KW@95..100 "true" [] [Skipped(",")] 4: GRAPHQL_ARGUMENT@100..120 - 0: GRAPHQL_NAME@100..113 - 0: GRAPHQL_NAME@100..113 "null_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@100..113 + 0: IDENT@100..113 "null_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@113..115 ":" [] [Whitespace(" ")] 2: GRAPHQL_NULL_VALUE@115..120 0: NULL_KW@115..120 "null" [] [Skipped(",")] 5: GRAPHQL_ARGUMENT@120..146 - 0: GRAPHQL_NAME@120..133 - 0: GRAPHQL_NAME@120..133 "enum_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@120..133 + 0: IDENT@120..133 "enum_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@133..135 ":" [] [Whitespace(" ")] 2: GRAPHQL_ENUM_VALUE@135..146 - 0: GRAPHQL_NAME@135..146 - 0: GRAPHQL_NAME@135..146 "ENUM_VALUE" [] [Skipped(",")] + 0: GRAPHQL_LITERAL_NAME@135..146 + 0: IDENT@135..146 "ENUM_VALUE" [] [Skipped(",")] 6: GRAPHQL_ARGUMENT@146..166 - 0: GRAPHQL_NAME@146..159 - 0: GRAPHQL_NAME@146..159 "enum_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@146..159 + 0: IDENT@146..159 "enum_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@159..161 ":" [] [Whitespace(" ")] 2: GRAPHQL_ENUM_VALUE@161..166 - 0: GRAPHQL_NAME@161..166 - 0: GRAPHQL_NAME@161..166 "enum" [] [Skipped(",")] + 0: GRAPHQL_LITERAL_NAME@161..166 + 0: IDENT@161..166 "enum" [] [Skipped(",")] 7: GRAPHQL_ARGUMENT@166..184 - 0: GRAPHQL_NAME@166..179 - 0: GRAPHQL_NAME@166..179 "enum_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@166..179 + 0: IDENT@166..179 "enum_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@179..181 ":" [] [Whitespace(" ")] 2: GRAPHQL_ENUM_VALUE@181..184 - 0: GRAPHQL_NAME@181..184 - 0: GRAPHQL_NAME@181..184 "on" [] [Skipped(",")] + 0: GRAPHQL_LITERAL_NAME@181..184 + 0: IDENT@181..184 "on" [] [Skipped(",")] 8: GRAPHQL_ARGUMENT@184..209 - 0: GRAPHQL_NAME@184..197 - 0: GRAPHQL_NAME@184..197 "list_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@184..197 + 0: IDENT@184..197 "list_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@197..199 ":" [] [Whitespace(" ")] 2: GRAPHQL_LIST_VALUE@199..209 0: L_BRACK@199..200 "[" [] [] @@ -297,22 +297,22 @@ GraphqlRoot { 0: GRAPHQL_INT_LITERAL@206..207 "3" [] [] 2: R_BRACK@207..209 "]" [] [Skipped(",")] 9: GRAPHQL_ARGUMENT@209..240 - 0: GRAPHQL_NAME@209..224 - 0: GRAPHQL_NAME@209..224 "object_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@209..224 + 0: IDENT@209..224 "object_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@224..226 ":" [] [Whitespace(" ")] 2: GRAPHQL_OBJECT_VALUE@226..240 0: L_CURLY@226..227 "{" [] [] 1: GRAPHQL_OBJECT_VALUE_MEMBER_LIST@227..239 0: GRAPHQL_OBJECT_FIELD@227..239 - 0: GRAPHQL_NAME@227..230 - 0: GRAPHQL_NAME@227..230 "key" [] [] + 0: GRAPHQL_LITERAL_NAME@227..230 + 0: IDENT@227..230 "key" [] [] 1: COLON@230..232 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@232..239 0: GRAPHQL_STRING_LITERAL@232..239 "\"value\"" [] [] 2: R_CURLY@239..240 "}" [] [] 10: GRAPHQL_ARGUMENT@240..294 - 0: GRAPHQL_NAME@240..260 - 0: GRAPHQL_NAME@240..260 "list_object_value" [Newline("\n"), Whitespace("\t\t")] [] + 0: GRAPHQL_LITERAL_NAME@240..260 + 0: IDENT@240..260 "list_object_value" [Newline("\n"), Whitespace("\t\t")] [] 1: COLON@260..262 ":" [] [Whitespace(" ")] 2: GRAPHQL_LIST_VALUE@262..294 0: L_BRACK@262..263 "[" [] [] @@ -321,8 +321,8 @@ GraphqlRoot { 0: L_CURLY@263..264 "{" [] [] 1: GRAPHQL_OBJECT_VALUE_MEMBER_LIST@264..276 0: GRAPHQL_OBJECT_FIELD@264..276 - 0: GRAPHQL_NAME@264..267 - 0: GRAPHQL_NAME@264..267 "key" [] [] + 0: GRAPHQL_LITERAL_NAME@264..267 + 0: IDENT@264..267 "key" [] [] 1: COLON@267..269 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@269..276 0: GRAPHQL_STRING_LITERAL@269..276 "\"value\"" [] [] @@ -331,8 +331,8 @@ GraphqlRoot { 0: L_CURLY@279..280 "{" [] [] 1: GRAPHQL_OBJECT_VALUE_MEMBER_LIST@280..292 0: GRAPHQL_OBJECT_FIELD@280..292 - 0: GRAPHQL_NAME@280..283 - 0: GRAPHQL_NAME@280..283 "key" [] [] + 0: GRAPHQL_LITERAL_NAME@280..283 + 0: IDENT@280..283 "key" [] [] 1: COLON@283..285 ":" [] [Whitespace(" ")] 2: GRAPHQL_STRING_VALUE@285..292 0: GRAPHQL_STRING_LITERAL@285..292 "\"value\"" [] [] diff --git a/crates/biome_graphql_syntax/src/generated/kind.rs b/crates/biome_graphql_syntax/src/generated/kind.rs index b0baddafd6fa..cf02dfb077af 100644 --- a/crates/biome_graphql_syntax/src/generated/kind.rs +++ b/crates/biome_graphql_syntax/src/generated/kind.rs @@ -71,10 +71,13 @@ pub enum GraphqlSyntaxKind { ERROR_TOKEN, NEWLINE, WHITESPACE, - GRAPHQL_NAME, + IDENT, COMMENT, COMMA, GRAPHQL_ROOT, + GRAPHQL_LITERAL_NAME, + GRAPHQL_NAME_BINDING, + GRAPHQL_NAME_REFERENCE, GRAPHQL_DEFINITION_LIST, GRAPHQL_FRAGMENT_DEFINITION, GRAPHQL_DIRECTIVE_DEFINITION, @@ -97,9 +100,9 @@ pub enum GraphqlSyntaxKind { GRAPHQL_ARGUMENT, GRAPHQL_FRAGMENT_SPREAD, GRAPHQL_INLINE_FRAGMENT, - GRAPHQL_FRAGMENT_NAME, GRAPHQL_TYPE_CONDITION, - GRAPHQL_VARIABLE, + GRAPHQL_VARIABLE_BINDING, + GRAPHQL_VARIABLE_REFERENCE, GRAPHQL_ENUM_VALUE, GRAPHQL_LIST_VALUE, GRAPHQL_LIST_VALUE_ELEMENT_LIST, @@ -111,7 +114,6 @@ pub enum GraphqlSyntaxKind { GRAPHQL_VARIABLE_DEFINITION, GRAPHQL_DEFAULT_VALUE, GRAPHQL_NON_NULL_TYPE, - GRAPHQL_NAMED_TYPE, GRAPHQL_LIST_TYPE, GRAPHQL_DIRECTIVE_LIST, GRAPHQL_DIRECTIVE, diff --git a/crates/biome_graphql_syntax/src/generated/macros.rs b/crates/biome_graphql_syntax/src/generated/macros.rs index ab1a6b67bb8b..485891fcdaaf 100644 --- a/crates/biome_graphql_syntax/src/generated/macros.rs +++ b/crates/biome_graphql_syntax/src/generated/macros.rs @@ -157,12 +157,16 @@ macro_rules! map_syntax_node { let $pattern = unsafe { $crate::GraphqlListValue::new_unchecked(node) }; $body } - $crate::GraphqlSyntaxKind::GRAPHQL_NAME => { - let $pattern = unsafe { $crate::GraphqlName::new_unchecked(node) }; + $crate::GraphqlSyntaxKind::GRAPHQL_LITERAL_NAME => { + let $pattern = unsafe { $crate::GraphqlLiteralName::new_unchecked(node) }; $body } - $crate::GraphqlSyntaxKind::GRAPHQL_NAMED_TYPE => { - let $pattern = unsafe { $crate::GraphqlNamedType::new_unchecked(node) }; + $crate::GraphqlSyntaxKind::GRAPHQL_NAME_BINDING => { + let $pattern = unsafe { $crate::GraphqlNameBinding::new_unchecked(node) }; + $body + } + $crate::GraphqlSyntaxKind::GRAPHQL_NAME_REFERENCE => { + let $pattern = unsafe { $crate::GraphqlNameReference::new_unchecked(node) }; $body } $crate::GraphqlSyntaxKind::GRAPHQL_NON_NULL_TYPE => { @@ -258,8 +262,8 @@ macro_rules! map_syntax_node { unsafe { $crate::GraphqlUnionTypeExtension::new_unchecked(node) }; $body } - $crate::GraphqlSyntaxKind::GRAPHQL_VARIABLE => { - let $pattern = unsafe { $crate::GraphqlVariable::new_unchecked(node) }; + $crate::GraphqlSyntaxKind::GRAPHQL_VARIABLE_BINDING => { + let $pattern = unsafe { $crate::GraphqlVariableBinding::new_unchecked(node) }; $body } $crate::GraphqlSyntaxKind::GRAPHQL_VARIABLE_DEFINITION => { @@ -272,6 +276,10 @@ macro_rules! map_syntax_node { unsafe { $crate::GraphqlVariableDefinitions::new_unchecked(node) }; $body } + $crate::GraphqlSyntaxKind::GRAPHQL_VARIABLE_REFERENCE => { + let $pattern = unsafe { $crate::GraphqlVariableReference::new_unchecked(node) }; + $body + } $crate::GraphqlSyntaxKind::GRAPHQL_BOGUS => { let $pattern = unsafe { $crate::GraphqlBogus::new_unchecked(node) }; $body diff --git a/crates/biome_graphql_syntax/src/generated/nodes.rs b/crates/biome_graphql_syntax/src/generated/nodes.rs index c75a34c5337e..a1b0b3fbc95e 100644 --- a/crates/biome_graphql_syntax/src/generated/nodes.rs +++ b/crates/biome_graphql_syntax/src/generated/nodes.rs @@ -45,7 +45,7 @@ impl GraphqlAlias { colon_token: self.colon_token(), } } - pub fn value(&self) -> SyntaxResult { + pub fn value(&self) -> SyntaxResult { support::required_node(&self.syntax, 0usize) } pub fn colon_token(&self) -> SyntaxResult { @@ -63,7 +63,7 @@ impl Serialize for GraphqlAlias { } #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlAliasFields { - pub value: SyntaxResult, + pub value: SyntaxResult, pub colon_token: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] @@ -87,7 +87,7 @@ impl GraphqlArgument { value: self.value(), } } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 0usize) } pub fn colon_token(&self) -> SyntaxResult { @@ -108,7 +108,7 @@ impl Serialize for GraphqlArgument { } #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlArgumentFields { - pub name: SyntaxResult, + pub name: SyntaxResult, pub colon_token: SyntaxResult, pub value: SyntaxResult, } @@ -341,7 +341,7 @@ impl GraphqlDirective { pub fn at_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } pub fn arguments(&self) -> Option { @@ -360,7 +360,7 @@ impl Serialize for GraphqlDirective { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlDirectiveFields { pub at_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub arguments: Option, } #[derive(Clone, PartialEq, Eq, Hash)] @@ -399,7 +399,7 @@ impl GraphqlDirectiveDefinition { pub fn at_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 2usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 3usize) } pub fn arguments(&self) -> Option { @@ -432,7 +432,7 @@ pub struct GraphqlDirectiveDefinitionFields { pub description: Option, pub directive_token: SyntaxResult, pub at_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub arguments: Option, pub repeatable_token: Option, pub on_token: SyntaxResult, @@ -504,7 +504,7 @@ impl GraphqlEnumTypeDefinition { pub fn enum_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn directives(&self) -> GraphqlDirectiveList { @@ -527,7 +527,7 @@ impl Serialize for GraphqlEnumTypeDefinition { pub struct GraphqlEnumTypeDefinitionFields { pub description: Option, pub enum_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub directives: GraphqlDirectiveList, pub enum_values: Option, } @@ -560,7 +560,7 @@ impl GraphqlEnumTypeExtension { pub fn enum_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn directives(&self) -> GraphqlDirectiveList { @@ -583,7 +583,7 @@ impl Serialize for GraphqlEnumTypeExtension { pub struct GraphqlEnumTypeExtensionFields { pub extend_token: SyntaxResult, pub enum_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub directives: GraphqlDirectiveList, pub enum_values: Option, } @@ -603,10 +603,10 @@ impl GraphqlEnumValue { } pub fn as_fields(&self) -> GraphqlEnumValueFields { GraphqlEnumValueFields { - graphql_name: self.graphql_name(), + value: self.value(), } } - pub fn graphql_name(&self) -> SyntaxResult { + pub fn value(&self) -> SyntaxResult { support::required_node(&self.syntax, 0usize) } } @@ -621,7 +621,7 @@ impl Serialize for GraphqlEnumValue { } #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlEnumValueFields { - pub graphql_name: SyntaxResult, + pub value: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] pub struct GraphqlEnumValueDefinition { @@ -647,7 +647,7 @@ impl GraphqlEnumValueDefinition { pub fn description(&self) -> Option { support::node(&self.syntax, 0usize) } - pub fn value(&self) -> SyntaxResult { + pub fn value(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } pub fn directives(&self) -> GraphqlDirectiveList { @@ -666,7 +666,7 @@ impl Serialize for GraphqlEnumValueDefinition { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlEnumValueDefinitionFields { pub description: Option, - pub value: SyntaxResult, + pub value: SyntaxResult, pub directives: GraphqlDirectiveList, } #[derive(Clone, PartialEq, Eq, Hash)] @@ -741,7 +741,7 @@ impl GraphqlField { pub fn alias(&self) -> Option { support::node(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } pub fn arguments(&self) -> Option { @@ -766,7 +766,7 @@ impl Serialize for GraphqlField { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlFieldFields { pub alias: Option, - pub name: SyntaxResult, + pub name: SyntaxResult, pub arguments: Option, pub directives: GraphqlDirectiveList, pub selection_set: Option, @@ -798,7 +798,7 @@ impl GraphqlFieldDefinition { pub fn description(&self) -> Option { support::node(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } pub fn arguments(&self) -> Option { @@ -826,7 +826,7 @@ impl Serialize for GraphqlFieldDefinition { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlFieldDefinitionFields { pub description: Option, - pub name: SyntaxResult, + pub name: SyntaxResult, pub arguments: Option, pub colon_token: SyntaxResult, pub ty: SyntaxResult, @@ -940,7 +940,7 @@ impl GraphqlFragmentDefinition { pub fn fragment_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } pub fn type_condition(&self) -> SyntaxResult { @@ -965,7 +965,7 @@ impl Serialize for GraphqlFragmentDefinition { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlFragmentDefinitionFields { pub fragment_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub type_condition: SyntaxResult, pub directives: GraphqlDirectiveList, pub selection_set: SyntaxResult, @@ -994,7 +994,7 @@ impl GraphqlFragmentSpread { pub fn dotdotdot_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } pub fn directives(&self) -> GraphqlDirectiveList { @@ -1013,7 +1013,7 @@ impl Serialize for GraphqlFragmentSpread { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlFragmentSpreadFields { pub dotdotdot_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub directives: GraphqlDirectiveList, } #[derive(Clone, PartialEq, Eq, Hash)] @@ -1188,7 +1188,7 @@ impl GraphqlInputObjectTypeDefinition { pub fn input_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn directives(&self) -> GraphqlDirectiveList { @@ -1211,7 +1211,7 @@ impl Serialize for GraphqlInputObjectTypeDefinition { pub struct GraphqlInputObjectTypeDefinitionFields { pub description: Option, pub input_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub directives: GraphqlDirectiveList, pub input_fields: Option, } @@ -1244,7 +1244,7 @@ impl GraphqlInputObjectTypeExtension { pub fn input_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn directives(&self) -> GraphqlDirectiveList { @@ -1267,7 +1267,7 @@ impl Serialize for GraphqlInputObjectTypeExtension { pub struct GraphqlInputObjectTypeExtensionFields { pub extend_token: SyntaxResult, pub input_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub directives: GraphqlDirectiveList, pub input_fields: Option, } @@ -1298,7 +1298,7 @@ impl GraphqlInputValueDefinition { pub fn description(&self) -> Option { support::node(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } pub fn colon_token(&self) -> SyntaxResult { @@ -1326,7 +1326,7 @@ impl Serialize for GraphqlInputValueDefinition { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlInputValueDefinitionFields { pub description: Option, - pub name: SyntaxResult, + pub name: SyntaxResult, pub colon_token: SyntaxResult, pub ty: SyntaxResult, pub default: Option, @@ -1398,7 +1398,7 @@ impl GraphqlInterfaceTypeDefinition { pub fn interface_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn implements(&self) -> Option { @@ -1424,7 +1424,7 @@ impl Serialize for GraphqlInterfaceTypeDefinition { pub struct GraphqlInterfaceTypeDefinitionFields { pub description: Option, pub interface_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub implements: Option, pub directives: GraphqlDirectiveList, pub fields: Option, @@ -1459,7 +1459,7 @@ impl GraphqlInterfaceTypeExtension { pub fn interface_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn implements(&self) -> Option { @@ -1485,7 +1485,7 @@ impl Serialize for GraphqlInterfaceTypeExtension { pub struct GraphqlInterfaceTypeExtensionFields { pub extend_token: SyntaxResult, pub interface_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub implements: Option, pub directives: GraphqlDirectiveList, pub fields: Option, @@ -1583,10 +1583,10 @@ pub struct GraphqlListValueFields { pub r_brack_token: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] -pub struct GraphqlName { +pub struct GraphqlLiteralName { pub(crate) syntax: SyntaxNode, } -impl GraphqlName { +impl GraphqlLiteralName { #[doc = r" Create an AstNode from a SyntaxNode without checking its kind"] #[doc = r""] #[doc = r" # Safety"] @@ -1596,8 +1596,8 @@ impl GraphqlName { pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { Self { syntax } } - pub fn as_fields(&self) -> GraphqlNameFields { - GraphqlNameFields { + pub fn as_fields(&self) -> GraphqlLiteralNameFields { + GraphqlLiteralNameFields { value_token: self.value_token(), } } @@ -1606,7 +1606,7 @@ impl GraphqlName { } } #[cfg(feature = "serde")] -impl Serialize for GraphqlName { +impl Serialize for GraphqlLiteralName { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -1615,14 +1615,14 @@ impl Serialize for GraphqlName { } } #[cfg_attr(feature = "serde", derive(Serialize))] -pub struct GraphqlNameFields { +pub struct GraphqlLiteralNameFields { pub value_token: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] -pub struct GraphqlNamedType { +pub struct GraphqlNameBinding { pub(crate) syntax: SyntaxNode, } -impl GraphqlNamedType { +impl GraphqlNameBinding { #[doc = r" Create an AstNode from a SyntaxNode without checking its kind"] #[doc = r""] #[doc = r" # Safety"] @@ -1632,15 +1632,53 @@ impl GraphqlNamedType { pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { Self { syntax } } - pub fn as_fields(&self) -> GraphqlNamedTypeFields { - GraphqlNamedTypeFields { name: self.name() } + pub fn as_fields(&self) -> GraphqlNameBindingFields { + GraphqlNameBindingFields { + value_token: self.value_token(), + } } - pub fn name(&self) -> SyntaxResult { - support::required_node(&self.syntax, 0usize) + pub fn value_token(&self) -> SyntaxResult { + support::required_token(&self.syntax, 0usize) + } +} +#[cfg(feature = "serde")] +impl Serialize for GraphqlNameBinding { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.as_fields().serialize(serializer) + } +} +#[cfg_attr(feature = "serde", derive(Serialize))] +pub struct GraphqlNameBindingFields { + pub value_token: SyntaxResult, +} +#[derive(Clone, PartialEq, Eq, Hash)] +pub struct GraphqlNameReference { + pub(crate) syntax: SyntaxNode, +} +impl GraphqlNameReference { + #[doc = r" Create an AstNode from a SyntaxNode without checking its kind"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r" This function must be guarded with a call to [AstNode::can_cast]"] + #[doc = r" or a match on [SyntaxNode::kind]"] + #[inline] + pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { + Self { syntax } + } + pub fn as_fields(&self) -> GraphqlNameReferenceFields { + GraphqlNameReferenceFields { + value_token: self.value_token(), + } + } + pub fn value_token(&self) -> SyntaxResult { + support::required_token(&self.syntax, 0usize) } } #[cfg(feature = "serde")] -impl Serialize for GraphqlNamedType { +impl Serialize for GraphqlNameReference { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -1649,8 +1687,8 @@ impl Serialize for GraphqlNamedType { } } #[cfg_attr(feature = "serde", derive(Serialize))] -pub struct GraphqlNamedTypeFields { - pub name: SyntaxResult, +pub struct GraphqlNameReferenceFields { + pub value_token: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] pub struct GraphqlNonNullType { @@ -1750,7 +1788,7 @@ impl GraphqlObjectField { value: self.value(), } } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 0usize) } pub fn colon_token(&self) -> SyntaxResult { @@ -1771,7 +1809,7 @@ impl Serialize for GraphqlObjectField { } #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlObjectFieldFields { - pub name: SyntaxResult, + pub name: SyntaxResult, pub colon_token: SyntaxResult, pub value: SyntaxResult, } @@ -1805,7 +1843,7 @@ impl GraphqlObjectTypeDefinition { pub fn type_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn implements(&self) -> Option { @@ -1831,7 +1869,7 @@ impl Serialize for GraphqlObjectTypeDefinition { pub struct GraphqlObjectTypeDefinitionFields { pub description: Option, pub type_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub implements: Option, pub directives: GraphqlDirectiveList, pub fields: Option, @@ -1866,7 +1904,7 @@ impl GraphqlObjectTypeExtension { pub fn type_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn implements(&self) -> Option { @@ -1892,7 +1930,7 @@ impl Serialize for GraphqlObjectTypeExtension { pub struct GraphqlObjectTypeExtensionFields { pub extend_token: SyntaxResult, pub type_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub implements: Option, pub directives: GraphqlDirectiveList, pub fields: Option, @@ -1969,7 +2007,7 @@ impl GraphqlOperationDefinition { pub fn ty(&self) -> SyntaxResult { support::required_node(&self.syntax, 0usize) } - pub fn name(&self) -> Option { + pub fn name(&self) -> Option { support::node(&self.syntax, 1usize) } pub fn variables(&self) -> Option { @@ -1994,7 +2032,7 @@ impl Serialize for GraphqlOperationDefinition { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlOperationDefinitionFields { pub ty: SyntaxResult, - pub name: Option, + pub name: Option, pub variables: Option, pub directives: GraphqlDirectiveList, pub selection_set: SyntaxResult, @@ -2108,7 +2146,7 @@ impl GraphqlRootOperationTypeDefinition { pub fn colon_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn named_type(&self) -> SyntaxResult { + pub fn named_type(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } } @@ -2125,7 +2163,7 @@ impl Serialize for GraphqlRootOperationTypeDefinition { pub struct GraphqlRootOperationTypeDefinitionFields { pub operation_type: SyntaxResult, pub colon_token: SyntaxResult, - pub named_type: SyntaxResult, + pub named_type: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] pub struct GraphqlRootOperationTypes { @@ -2201,7 +2239,7 @@ impl GraphqlScalarTypeDefinition { pub fn scalar_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn directives(&self) -> GraphqlDirectiveList { @@ -2221,7 +2259,7 @@ impl Serialize for GraphqlScalarTypeDefinition { pub struct GraphqlScalarTypeDefinitionFields { pub description: Option, pub scalar_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub directives: GraphqlDirectiveList, } #[derive(Clone, PartialEq, Eq, Hash)] @@ -2252,7 +2290,7 @@ impl GraphqlScalarTypeExtension { pub fn scalar_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn directives(&self) -> GraphqlDirectiveList { @@ -2272,7 +2310,7 @@ impl Serialize for GraphqlScalarTypeExtension { pub struct GraphqlScalarTypeExtensionFields { pub extend_token: SyntaxResult, pub scalar_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub directives: GraphqlDirectiveList, } #[derive(Clone, PartialEq, Eq, Hash)] @@ -2482,7 +2520,7 @@ impl GraphqlTypeCondition { pub fn on_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 0usize) } - pub fn ty(&self) -> SyntaxResult { + pub fn ty(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } } @@ -2498,7 +2536,7 @@ impl Serialize for GraphqlTypeCondition { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlTypeConditionFields { pub on_token: SyntaxResult, - pub ty: SyntaxResult, + pub ty: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] pub struct GraphqlUnionMemberTypes { @@ -2575,7 +2613,7 @@ impl GraphqlUnionTypeDefinition { pub fn union_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn directives(&self) -> GraphqlDirectiveList { @@ -2598,7 +2636,7 @@ impl Serialize for GraphqlUnionTypeDefinition { pub struct GraphqlUnionTypeDefinitionFields { pub description: Option, pub union_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub directives: GraphqlDirectiveList, pub union_members: Option, } @@ -2631,7 +2669,7 @@ impl GraphqlUnionTypeExtension { pub fn union_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 1usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 2usize) } pub fn directives(&self) -> GraphqlDirectiveList { @@ -2654,15 +2692,15 @@ impl Serialize for GraphqlUnionTypeExtension { pub struct GraphqlUnionTypeExtensionFields { pub extend_token: SyntaxResult, pub union_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub directives: GraphqlDirectiveList, pub union_members: Option, } #[derive(Clone, PartialEq, Eq, Hash)] -pub struct GraphqlVariable { +pub struct GraphqlVariableBinding { pub(crate) syntax: SyntaxNode, } -impl GraphqlVariable { +impl GraphqlVariableBinding { #[doc = r" Create an AstNode from a SyntaxNode without checking its kind"] #[doc = r""] #[doc = r" # Safety"] @@ -2672,8 +2710,8 @@ impl GraphqlVariable { pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { Self { syntax } } - pub fn as_fields(&self) -> GraphqlVariableFields { - GraphqlVariableFields { + pub fn as_fields(&self) -> GraphqlVariableBindingFields { + GraphqlVariableBindingFields { dollar_token: self.dollar_token(), name: self.name(), } @@ -2681,12 +2719,12 @@ impl GraphqlVariable { pub fn dollar_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } } #[cfg(feature = "serde")] -impl Serialize for GraphqlVariable { +impl Serialize for GraphqlVariableBinding { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -2695,9 +2733,9 @@ impl Serialize for GraphqlVariable { } } #[cfg_attr(feature = "serde", derive(Serialize))] -pub struct GraphqlVariableFields { +pub struct GraphqlVariableBindingFields { pub dollar_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] pub struct GraphqlVariableDefinition { @@ -2722,7 +2760,7 @@ impl GraphqlVariableDefinition { directives: self.directives(), } } - pub fn variable(&self) -> SyntaxResult { + pub fn variable(&self) -> SyntaxResult { support::required_node(&self.syntax, 0usize) } pub fn colon_token(&self) -> SyntaxResult { @@ -2749,7 +2787,7 @@ impl Serialize for GraphqlVariableDefinition { } #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlVariableDefinitionFields { - pub variable: SyntaxResult, + pub variable: SyntaxResult, pub colon_token: SyntaxResult, pub ty: SyntaxResult, pub default: Option, @@ -2802,55 +2840,81 @@ pub struct GraphqlVariableDefinitionsFields { pub r_paren_token: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] +pub struct GraphqlVariableReference { + pub(crate) syntax: SyntaxNode, +} +impl GraphqlVariableReference { + #[doc = r" Create an AstNode from a SyntaxNode without checking its kind"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r" This function must be guarded with a call to [AstNode::can_cast]"] + #[doc = r" or a match on [SyntaxNode::kind]"] + #[inline] + pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { + Self { syntax } + } + pub fn as_fields(&self) -> GraphqlVariableReferenceFields { + GraphqlVariableReferenceFields { + dollar_token: self.dollar_token(), + name: self.name(), + } + } + pub fn dollar_token(&self) -> SyntaxResult { + support::required_token(&self.syntax, 0usize) + } + pub fn name(&self) -> SyntaxResult { + support::required_node(&self.syntax, 1usize) + } +} +#[cfg(feature = "serde")] +impl Serialize for GraphqlVariableReference { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.as_fields().serialize(serializer) + } +} +#[cfg_attr(feature = "serde", derive(Serialize))] +pub struct GraphqlVariableReferenceFields { + pub dollar_token: SyntaxResult, + pub name: SyntaxResult, +} +#[derive(Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize))] pub enum AnyGraphqlDefinition { - AnyGraphqlOperationDefinition(AnyGraphqlOperationDefinition), + AnyGraphqlTypeDefinition(AnyGraphqlTypeDefinition), + AnyGraphqlTypeExtension(AnyGraphqlTypeExtension), GraphqlBogusDefinition(GraphqlBogusDefinition), GraphqlDirectiveDefinition(GraphqlDirectiveDefinition), - GraphqlEnumTypeDefinition(GraphqlEnumTypeDefinition), - GraphqlEnumTypeExtension(GraphqlEnumTypeExtension), GraphqlFragmentDefinition(GraphqlFragmentDefinition), - GraphqlInputObjectTypeDefinition(GraphqlInputObjectTypeDefinition), - GraphqlInputObjectTypeExtension(GraphqlInputObjectTypeExtension), - GraphqlInterfaceTypeDefinition(GraphqlInterfaceTypeDefinition), - GraphqlInterfaceTypeExtension(GraphqlInterfaceTypeExtension), - GraphqlObjectTypeDefinition(GraphqlObjectTypeDefinition), - GraphqlObjectTypeExtension(GraphqlObjectTypeExtension), - GraphqlScalarTypeDefinition(GraphqlScalarTypeDefinition), - GraphqlScalarTypeExtension(GraphqlScalarTypeExtension), + GraphqlOperationDefinition(GraphqlOperationDefinition), GraphqlSchemaDefinition(GraphqlSchemaDefinition), GraphqlSchemaExtension(GraphqlSchemaExtension), - GraphqlUnionTypeDefinition(GraphqlUnionTypeDefinition), - GraphqlUnionTypeExtension(GraphqlUnionTypeExtension), + GraphqlSelectionSet(GraphqlSelectionSet), } impl AnyGraphqlDefinition { - pub fn as_any_graphql_operation_definition(&self) -> Option<&AnyGraphqlOperationDefinition> { - match &self { - AnyGraphqlDefinition::AnyGraphqlOperationDefinition(item) => Some(item), - _ => None, - } - } - pub fn as_graphql_bogus_definition(&self) -> Option<&GraphqlBogusDefinition> { + pub fn as_any_graphql_type_definition(&self) -> Option<&AnyGraphqlTypeDefinition> { match &self { - AnyGraphqlDefinition::GraphqlBogusDefinition(item) => Some(item), + AnyGraphqlDefinition::AnyGraphqlTypeDefinition(item) => Some(item), _ => None, } } - pub fn as_graphql_directive_definition(&self) -> Option<&GraphqlDirectiveDefinition> { + pub fn as_any_graphql_type_extension(&self) -> Option<&AnyGraphqlTypeExtension> { match &self { - AnyGraphqlDefinition::GraphqlDirectiveDefinition(item) => Some(item), + AnyGraphqlDefinition::AnyGraphqlTypeExtension(item) => Some(item), _ => None, } } - pub fn as_graphql_enum_type_definition(&self) -> Option<&GraphqlEnumTypeDefinition> { + pub fn as_graphql_bogus_definition(&self) -> Option<&GraphqlBogusDefinition> { match &self { - AnyGraphqlDefinition::GraphqlEnumTypeDefinition(item) => Some(item), + AnyGraphqlDefinition::GraphqlBogusDefinition(item) => Some(item), _ => None, } } - pub fn as_graphql_enum_type_extension(&self) -> Option<&GraphqlEnumTypeExtension> { + pub fn as_graphql_directive_definition(&self) -> Option<&GraphqlDirectiveDefinition> { match &self { - AnyGraphqlDefinition::GraphqlEnumTypeExtension(item) => Some(item), + AnyGraphqlDefinition::GraphqlDirectiveDefinition(item) => Some(item), _ => None, } } @@ -2860,55 +2924,9 @@ impl AnyGraphqlDefinition { _ => None, } } - pub fn as_graphql_input_object_type_definition( - &self, - ) -> Option<&GraphqlInputObjectTypeDefinition> { - match &self { - AnyGraphqlDefinition::GraphqlInputObjectTypeDefinition(item) => Some(item), - _ => None, - } - } - pub fn as_graphql_input_object_type_extension( - &self, - ) -> Option<&GraphqlInputObjectTypeExtension> { - match &self { - AnyGraphqlDefinition::GraphqlInputObjectTypeExtension(item) => Some(item), - _ => None, - } - } - pub fn as_graphql_interface_type_definition(&self) -> Option<&GraphqlInterfaceTypeDefinition> { - match &self { - AnyGraphqlDefinition::GraphqlInterfaceTypeDefinition(item) => Some(item), - _ => None, - } - } - pub fn as_graphql_interface_type_extension(&self) -> Option<&GraphqlInterfaceTypeExtension> { - match &self { - AnyGraphqlDefinition::GraphqlInterfaceTypeExtension(item) => Some(item), - _ => None, - } - } - pub fn as_graphql_object_type_definition(&self) -> Option<&GraphqlObjectTypeDefinition> { - match &self { - AnyGraphqlDefinition::GraphqlObjectTypeDefinition(item) => Some(item), - _ => None, - } - } - pub fn as_graphql_object_type_extension(&self) -> Option<&GraphqlObjectTypeExtension> { - match &self { - AnyGraphqlDefinition::GraphqlObjectTypeExtension(item) => Some(item), - _ => None, - } - } - pub fn as_graphql_scalar_type_definition(&self) -> Option<&GraphqlScalarTypeDefinition> { - match &self { - AnyGraphqlDefinition::GraphqlScalarTypeDefinition(item) => Some(item), - _ => None, - } - } - pub fn as_graphql_scalar_type_extension(&self) -> Option<&GraphqlScalarTypeExtension> { + pub fn as_graphql_operation_definition(&self) -> Option<&GraphqlOperationDefinition> { match &self { - AnyGraphqlDefinition::GraphqlScalarTypeExtension(item) => Some(item), + AnyGraphqlDefinition::GraphqlOperationDefinition(item) => Some(item), _ => None, } } @@ -2924,15 +2942,9 @@ impl AnyGraphqlDefinition { _ => None, } } - pub fn as_graphql_union_type_definition(&self) -> Option<&GraphqlUnionTypeDefinition> { - match &self { - AnyGraphqlDefinition::GraphqlUnionTypeDefinition(item) => Some(item), - _ => None, - } - } - pub fn as_graphql_union_type_extension(&self) -> Option<&GraphqlUnionTypeExtension> { + pub fn as_graphql_selection_set(&self) -> Option<&GraphqlSelectionSet> { match &self { - AnyGraphqlDefinition::GraphqlUnionTypeExtension(item) => Some(item), + AnyGraphqlDefinition::GraphqlSelectionSet(item) => Some(item), _ => None, } } @@ -2961,7 +2973,7 @@ impl AnyGraphqlOperationDefinition { #[cfg_attr(feature = "serde", derive(Serialize))] pub enum AnyGraphqlPrimitiveType { GraphqlListType(GraphqlListType), - GraphqlNamedType(GraphqlNamedType), + GraphqlNameReference(GraphqlNameReference), } impl AnyGraphqlPrimitiveType { pub fn as_graphql_list_type(&self) -> Option<&GraphqlListType> { @@ -2970,9 +2982,9 @@ impl AnyGraphqlPrimitiveType { _ => None, } } - pub fn as_graphql_named_type(&self) -> Option<&GraphqlNamedType> { + pub fn as_graphql_name_reference(&self) -> Option<&GraphqlNameReference> { match &self { - AnyGraphqlPrimitiveType::GraphqlNamedType(item) => Some(item), + AnyGraphqlPrimitiveType::GraphqlNameReference(item) => Some(item), _ => None, } } @@ -3040,6 +3052,106 @@ impl AnyGraphqlType { } #[derive(Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize))] +pub enum AnyGraphqlTypeDefinition { + GraphqlEnumTypeDefinition(GraphqlEnumTypeDefinition), + GraphqlInputObjectTypeDefinition(GraphqlInputObjectTypeDefinition), + GraphqlInterfaceTypeDefinition(GraphqlInterfaceTypeDefinition), + GraphqlObjectTypeDefinition(GraphqlObjectTypeDefinition), + GraphqlScalarTypeDefinition(GraphqlScalarTypeDefinition), + GraphqlUnionTypeDefinition(GraphqlUnionTypeDefinition), +} +impl AnyGraphqlTypeDefinition { + pub fn as_graphql_enum_type_definition(&self) -> Option<&GraphqlEnumTypeDefinition> { + match &self { + AnyGraphqlTypeDefinition::GraphqlEnumTypeDefinition(item) => Some(item), + _ => None, + } + } + pub fn as_graphql_input_object_type_definition( + &self, + ) -> Option<&GraphqlInputObjectTypeDefinition> { + match &self { + AnyGraphqlTypeDefinition::GraphqlInputObjectTypeDefinition(item) => Some(item), + _ => None, + } + } + pub fn as_graphql_interface_type_definition(&self) -> Option<&GraphqlInterfaceTypeDefinition> { + match &self { + AnyGraphqlTypeDefinition::GraphqlInterfaceTypeDefinition(item) => Some(item), + _ => None, + } + } + pub fn as_graphql_object_type_definition(&self) -> Option<&GraphqlObjectTypeDefinition> { + match &self { + AnyGraphqlTypeDefinition::GraphqlObjectTypeDefinition(item) => Some(item), + _ => None, + } + } + pub fn as_graphql_scalar_type_definition(&self) -> Option<&GraphqlScalarTypeDefinition> { + match &self { + AnyGraphqlTypeDefinition::GraphqlScalarTypeDefinition(item) => Some(item), + _ => None, + } + } + pub fn as_graphql_union_type_definition(&self) -> Option<&GraphqlUnionTypeDefinition> { + match &self { + AnyGraphqlTypeDefinition::GraphqlUnionTypeDefinition(item) => Some(item), + _ => None, + } + } +} +#[derive(Clone, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "serde", derive(Serialize))] +pub enum AnyGraphqlTypeExtension { + GraphqlEnumTypeExtension(GraphqlEnumTypeExtension), + GraphqlInputObjectTypeExtension(GraphqlInputObjectTypeExtension), + GraphqlInterfaceTypeExtension(GraphqlInterfaceTypeExtension), + GraphqlObjectTypeExtension(GraphqlObjectTypeExtension), + GraphqlScalarTypeExtension(GraphqlScalarTypeExtension), + GraphqlUnionTypeExtension(GraphqlUnionTypeExtension), +} +impl AnyGraphqlTypeExtension { + pub fn as_graphql_enum_type_extension(&self) -> Option<&GraphqlEnumTypeExtension> { + match &self { + AnyGraphqlTypeExtension::GraphqlEnumTypeExtension(item) => Some(item), + _ => None, + } + } + pub fn as_graphql_input_object_type_extension( + &self, + ) -> Option<&GraphqlInputObjectTypeExtension> { + match &self { + AnyGraphqlTypeExtension::GraphqlInputObjectTypeExtension(item) => Some(item), + _ => None, + } + } + pub fn as_graphql_interface_type_extension(&self) -> Option<&GraphqlInterfaceTypeExtension> { + match &self { + AnyGraphqlTypeExtension::GraphqlInterfaceTypeExtension(item) => Some(item), + _ => None, + } + } + pub fn as_graphql_object_type_extension(&self) -> Option<&GraphqlObjectTypeExtension> { + match &self { + AnyGraphqlTypeExtension::GraphqlObjectTypeExtension(item) => Some(item), + _ => None, + } + } + pub fn as_graphql_scalar_type_extension(&self) -> Option<&GraphqlScalarTypeExtension> { + match &self { + AnyGraphqlTypeExtension::GraphqlScalarTypeExtension(item) => Some(item), + _ => None, + } + } + pub fn as_graphql_union_type_extension(&self) -> Option<&GraphqlUnionTypeExtension> { + match &self { + AnyGraphqlTypeExtension::GraphqlUnionTypeExtension(item) => Some(item), + _ => None, + } + } +} +#[derive(Clone, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "serde", derive(Serialize))] pub enum AnyGraphqlValue { GraphqlBogusValue(GraphqlBogusValue), GraphqlBooleanValue(GraphqlBooleanValue), @@ -3050,7 +3162,7 @@ pub enum AnyGraphqlValue { GraphqlNullValue(GraphqlNullValue), GraphqlObjectValue(GraphqlObjectValue), GraphqlStringValue(GraphqlStringValue), - GraphqlVariable(GraphqlVariable), + GraphqlVariableReference(GraphqlVariableReference), } impl AnyGraphqlValue { pub fn as_graphql_bogus_value(&self) -> Option<&GraphqlBogusValue> { @@ -3107,9 +3219,9 @@ impl AnyGraphqlValue { _ => None, } } - pub fn as_graphql_variable(&self) -> Option<&GraphqlVariable> { + pub fn as_graphql_variable_reference(&self) -> Option<&GraphqlVariableReference> { match &self { - AnyGraphqlValue::GraphqlVariable(item) => Some(item), + AnyGraphqlValue::GraphqlVariableReference(item) => Some(item), _ => None, } } @@ -3677,10 +3789,7 @@ impl AstNode for GraphqlEnumValue { impl std::fmt::Debug for GraphqlEnumValue { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("GraphqlEnumValue") - .field( - "graphql_name", - &support::DebugSyntaxResult(self.graphql_name()), - ) + .field("value", &support::DebugSyntaxResult(self.value())) .finish() } } @@ -4594,12 +4703,12 @@ impl From for SyntaxElement { n.syntax.into() } } -impl AstNode for GraphqlName { +impl AstNode for GraphqlLiteralName { type Language = Language; const KIND_SET: SyntaxKindSet = - SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_NAME as u16)); + SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_LITERAL_NAME as u16)); fn can_cast(kind: SyntaxKind) -> bool { - kind == GRAPHQL_NAME + kind == GRAPHQL_LITERAL_NAME } fn cast(syntax: SyntaxNode) -> Option { if Self::can_cast(syntax.kind()) { @@ -4615,9 +4724,9 @@ impl AstNode for GraphqlName { self.syntax } } -impl std::fmt::Debug for GraphqlName { +impl std::fmt::Debug for GraphqlLiteralName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("GraphqlName") + f.debug_struct("GraphqlLiteralName") .field( "value_token", &support::DebugSyntaxResult(self.value_token()), @@ -4625,22 +4734,22 @@ impl std::fmt::Debug for GraphqlName { .finish() } } -impl From for SyntaxNode { - fn from(n: GraphqlName) -> SyntaxNode { +impl From for SyntaxNode { + fn from(n: GraphqlLiteralName) -> SyntaxNode { n.syntax } } -impl From for SyntaxElement { - fn from(n: GraphqlName) -> SyntaxElement { +impl From for SyntaxElement { + fn from(n: GraphqlLiteralName) -> SyntaxElement { n.syntax.into() } } -impl AstNode for GraphqlNamedType { +impl AstNode for GraphqlNameBinding { type Language = Language; const KIND_SET: SyntaxKindSet = - SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_NAMED_TYPE as u16)); + SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_NAME_BINDING as u16)); fn can_cast(kind: SyntaxKind) -> bool { - kind == GRAPHQL_NAMED_TYPE + kind == GRAPHQL_NAME_BINDING } fn cast(syntax: SyntaxNode) -> Option { if Self::can_cast(syntax.kind()) { @@ -4656,29 +4765,32 @@ impl AstNode for GraphqlNamedType { self.syntax } } -impl std::fmt::Debug for GraphqlNamedType { +impl std::fmt::Debug for GraphqlNameBinding { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("GraphqlNamedType") - .field("name", &support::DebugSyntaxResult(self.name())) + f.debug_struct("GraphqlNameBinding") + .field( + "value_token", + &support::DebugSyntaxResult(self.value_token()), + ) .finish() } } -impl From for SyntaxNode { - fn from(n: GraphqlNamedType) -> SyntaxNode { +impl From for SyntaxNode { + fn from(n: GraphqlNameBinding) -> SyntaxNode { n.syntax } } -impl From for SyntaxElement { - fn from(n: GraphqlNamedType) -> SyntaxElement { +impl From for SyntaxElement { + fn from(n: GraphqlNameBinding) -> SyntaxElement { n.syntax.into() } } -impl AstNode for GraphqlNonNullType { +impl AstNode for GraphqlNameReference { type Language = Language; const KIND_SET: SyntaxKindSet = - SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_NON_NULL_TYPE as u16)); + SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_NAME_REFERENCE as u16)); fn can_cast(kind: SyntaxKind) -> bool { - kind == GRAPHQL_NON_NULL_TYPE + kind == GRAPHQL_NAME_REFERENCE } fn cast(syntax: SyntaxNode) -> Option { if Self::can_cast(syntax.kind()) { @@ -4694,28 +4806,69 @@ impl AstNode for GraphqlNonNullType { self.syntax } } -impl std::fmt::Debug for GraphqlNonNullType { +impl std::fmt::Debug for GraphqlNameReference { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("GraphqlNonNullType") - .field("base", &support::DebugSyntaxResult(self.base())) - .field("excl_token", &support::DebugSyntaxResult(self.excl_token())) + f.debug_struct("GraphqlNameReference") + .field( + "value_token", + &support::DebugSyntaxResult(self.value_token()), + ) .finish() } } -impl From for SyntaxNode { - fn from(n: GraphqlNonNullType) -> SyntaxNode { +impl From for SyntaxNode { + fn from(n: GraphqlNameReference) -> SyntaxNode { n.syntax } } -impl From for SyntaxElement { - fn from(n: GraphqlNonNullType) -> SyntaxElement { +impl From for SyntaxElement { + fn from(n: GraphqlNameReference) -> SyntaxElement { n.syntax.into() } } -impl AstNode for GraphqlNullValue { +impl AstNode for GraphqlNonNullType { type Language = Language; const KIND_SET: SyntaxKindSet = - SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_NULL_VALUE as u16)); + SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_NON_NULL_TYPE as u16)); + fn can_cast(kind: SyntaxKind) -> bool { + kind == GRAPHQL_NON_NULL_TYPE + } + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + fn syntax(&self) -> &SyntaxNode { + &self.syntax + } + fn into_syntax(self) -> SyntaxNode { + self.syntax + } +} +impl std::fmt::Debug for GraphqlNonNullType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("GraphqlNonNullType") + .field("base", &support::DebugSyntaxResult(self.base())) + .field("excl_token", &support::DebugSyntaxResult(self.excl_token())) + .finish() + } +} +impl From for SyntaxNode { + fn from(n: GraphqlNonNullType) -> SyntaxNode { + n.syntax + } +} +impl From for SyntaxElement { + fn from(n: GraphqlNonNullType) -> SyntaxElement { + n.syntax.into() + } +} +impl AstNode for GraphqlNullValue { + type Language = Language; + const KIND_SET: SyntaxKindSet = + SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_NULL_VALUE as u16)); fn can_cast(kind: SyntaxKind) -> bool { kind == GRAPHQL_NULL_VALUE } @@ -5626,12 +5779,12 @@ impl From for SyntaxElement { n.syntax.into() } } -impl AstNode for GraphqlVariable { +impl AstNode for GraphqlVariableBinding { type Language = Language; const KIND_SET: SyntaxKindSet = - SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_VARIABLE as u16)); + SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_VARIABLE_BINDING as u16)); fn can_cast(kind: SyntaxKind) -> bool { - kind == GRAPHQL_VARIABLE + kind == GRAPHQL_VARIABLE_BINDING } fn cast(syntax: SyntaxNode) -> Option { if Self::can_cast(syntax.kind()) { @@ -5647,9 +5800,9 @@ impl AstNode for GraphqlVariable { self.syntax } } -impl std::fmt::Debug for GraphqlVariable { +impl std::fmt::Debug for GraphqlVariableBinding { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("GraphqlVariable") + f.debug_struct("GraphqlVariableBinding") .field( "dollar_token", &support::DebugSyntaxResult(self.dollar_token()), @@ -5658,13 +5811,13 @@ impl std::fmt::Debug for GraphqlVariable { .finish() } } -impl From for SyntaxNode { - fn from(n: GraphqlVariable) -> SyntaxNode { +impl From for SyntaxNode { + fn from(n: GraphqlVariableBinding) -> SyntaxNode { n.syntax } } -impl From for SyntaxElement { - fn from(n: GraphqlVariable) -> SyntaxElement { +impl From for SyntaxElement { + fn from(n: GraphqlVariableBinding) -> SyntaxElement { n.syntax.into() } } @@ -5759,69 +5912,66 @@ impl From for SyntaxElement { n.syntax.into() } } -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlBogusDefinition) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlBogusDefinition(node) - } -} -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlDirectiveDefinition) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlDirectiveDefinition(node) - } -} -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlEnumTypeDefinition) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlEnumTypeDefinition(node) +impl AstNode for GraphqlVariableReference { + type Language = Language; + const KIND_SET: SyntaxKindSet = + SyntaxKindSet::from_raw(RawSyntaxKind(GRAPHQL_VARIABLE_REFERENCE as u16)); + fn can_cast(kind: SyntaxKind) -> bool { + kind == GRAPHQL_VARIABLE_REFERENCE } -} -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlEnumTypeExtension) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlEnumTypeExtension(node) + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } } -} -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlFragmentDefinition) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlFragmentDefinition(node) + fn syntax(&self) -> &SyntaxNode { + &self.syntax } -} -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlInputObjectTypeDefinition) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlInputObjectTypeDefinition(node) + fn into_syntax(self) -> SyntaxNode { + self.syntax } } -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlInputObjectTypeExtension) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlInputObjectTypeExtension(node) +impl std::fmt::Debug for GraphqlVariableReference { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("GraphqlVariableReference") + .field( + "dollar_token", + &support::DebugSyntaxResult(self.dollar_token()), + ) + .field("name", &support::DebugSyntaxResult(self.name())) + .finish() } } -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlInterfaceTypeDefinition) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlInterfaceTypeDefinition(node) +impl From for SyntaxNode { + fn from(n: GraphqlVariableReference) -> SyntaxNode { + n.syntax } } -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlInterfaceTypeExtension) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlInterfaceTypeExtension(node) +impl From for SyntaxElement { + fn from(n: GraphqlVariableReference) -> SyntaxElement { + n.syntax.into() } } -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlObjectTypeDefinition) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlObjectTypeDefinition(node) +impl From for AnyGraphqlDefinition { + fn from(node: GraphqlBogusDefinition) -> AnyGraphqlDefinition { + AnyGraphqlDefinition::GraphqlBogusDefinition(node) } } -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlObjectTypeExtension) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlObjectTypeExtension(node) +impl From for AnyGraphqlDefinition { + fn from(node: GraphqlDirectiveDefinition) -> AnyGraphqlDefinition { + AnyGraphqlDefinition::GraphqlDirectiveDefinition(node) } } -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlScalarTypeDefinition) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlScalarTypeDefinition(node) +impl From for AnyGraphqlDefinition { + fn from(node: GraphqlFragmentDefinition) -> AnyGraphqlDefinition { + AnyGraphqlDefinition::GraphqlFragmentDefinition(node) } } -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlScalarTypeExtension) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlScalarTypeExtension(node) +impl From for AnyGraphqlDefinition { + fn from(node: GraphqlOperationDefinition) -> AnyGraphqlDefinition { + AnyGraphqlDefinition::GraphqlOperationDefinition(node) } } impl From for AnyGraphqlDefinition { @@ -5834,56 +5984,33 @@ impl From for AnyGraphqlDefinition { AnyGraphqlDefinition::GraphqlSchemaExtension(node) } } -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlUnionTypeDefinition) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlUnionTypeDefinition(node) - } -} -impl From for AnyGraphqlDefinition { - fn from(node: GraphqlUnionTypeExtension) -> AnyGraphqlDefinition { - AnyGraphqlDefinition::GraphqlUnionTypeExtension(node) +impl From for AnyGraphqlDefinition { + fn from(node: GraphqlSelectionSet) -> AnyGraphqlDefinition { + AnyGraphqlDefinition::GraphqlSelectionSet(node) } } impl AstNode for AnyGraphqlDefinition { type Language = Language; - const KIND_SET: SyntaxKindSet = AnyGraphqlOperationDefinition::KIND_SET + const KIND_SET: SyntaxKindSet = AnyGraphqlTypeDefinition::KIND_SET + .union(AnyGraphqlTypeExtension::KIND_SET) .union(GraphqlBogusDefinition::KIND_SET) .union(GraphqlDirectiveDefinition::KIND_SET) - .union(GraphqlEnumTypeDefinition::KIND_SET) - .union(GraphqlEnumTypeExtension::KIND_SET) .union(GraphqlFragmentDefinition::KIND_SET) - .union(GraphqlInputObjectTypeDefinition::KIND_SET) - .union(GraphqlInputObjectTypeExtension::KIND_SET) - .union(GraphqlInterfaceTypeDefinition::KIND_SET) - .union(GraphqlInterfaceTypeExtension::KIND_SET) - .union(GraphqlObjectTypeDefinition::KIND_SET) - .union(GraphqlObjectTypeExtension::KIND_SET) - .union(GraphqlScalarTypeDefinition::KIND_SET) - .union(GraphqlScalarTypeExtension::KIND_SET) + .union(GraphqlOperationDefinition::KIND_SET) .union(GraphqlSchemaDefinition::KIND_SET) .union(GraphqlSchemaExtension::KIND_SET) - .union(GraphqlUnionTypeDefinition::KIND_SET) - .union(GraphqlUnionTypeExtension::KIND_SET); + .union(GraphqlSelectionSet::KIND_SET); fn can_cast(kind: SyntaxKind) -> bool { match kind { GRAPHQL_BOGUS_DEFINITION | GRAPHQL_DIRECTIVE_DEFINITION - | GRAPHQL_ENUM_TYPE_DEFINITION - | GRAPHQL_ENUM_TYPE_EXTENSION | GRAPHQL_FRAGMENT_DEFINITION - | GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION - | GRAPHQL_INPUT_OBJECT_TYPE_EXTENSION - | GRAPHQL_INTERFACE_TYPE_DEFINITION - | GRAPHQL_INTERFACE_TYPE_EXTENSION - | GRAPHQL_OBJECT_TYPE_DEFINITION - | GRAPHQL_OBJECT_TYPE_EXTENSION - | GRAPHQL_SCALAR_TYPE_DEFINITION - | GRAPHQL_SCALAR_TYPE_EXTENSION + | GRAPHQL_OPERATION_DEFINITION | GRAPHQL_SCHEMA_DEFINITION | GRAPHQL_SCHEMA_EXTENSION - | GRAPHQL_UNION_TYPE_DEFINITION - | GRAPHQL_UNION_TYPE_EXTENSION => true, - k if AnyGraphqlOperationDefinition::can_cast(k) => true, + | GRAPHQL_SELECTION_SET => true, + k if AnyGraphqlTypeDefinition::can_cast(k) => true, + k if AnyGraphqlTypeExtension::can_cast(k) => true, _ => false, } } @@ -5897,56 +6024,13 @@ impl AstNode for AnyGraphqlDefinition { syntax, }) } - GRAPHQL_ENUM_TYPE_DEFINITION => { - AnyGraphqlDefinition::GraphqlEnumTypeDefinition(GraphqlEnumTypeDefinition { - syntax, - }) - } - GRAPHQL_ENUM_TYPE_EXTENSION => { - AnyGraphqlDefinition::GraphqlEnumTypeExtension(GraphqlEnumTypeExtension { syntax }) - } GRAPHQL_FRAGMENT_DEFINITION => { AnyGraphqlDefinition::GraphqlFragmentDefinition(GraphqlFragmentDefinition { syntax, }) } - GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION => { - AnyGraphqlDefinition::GraphqlInputObjectTypeDefinition( - GraphqlInputObjectTypeDefinition { syntax }, - ) - } - GRAPHQL_INPUT_OBJECT_TYPE_EXTENSION => { - AnyGraphqlDefinition::GraphqlInputObjectTypeExtension( - GraphqlInputObjectTypeExtension { syntax }, - ) - } - GRAPHQL_INTERFACE_TYPE_DEFINITION => { - AnyGraphqlDefinition::GraphqlInterfaceTypeDefinition( - GraphqlInterfaceTypeDefinition { syntax }, - ) - } - GRAPHQL_INTERFACE_TYPE_EXTENSION => { - AnyGraphqlDefinition::GraphqlInterfaceTypeExtension(GraphqlInterfaceTypeExtension { - syntax, - }) - } - GRAPHQL_OBJECT_TYPE_DEFINITION => { - AnyGraphqlDefinition::GraphqlObjectTypeDefinition(GraphqlObjectTypeDefinition { - syntax, - }) - } - GRAPHQL_OBJECT_TYPE_EXTENSION => { - AnyGraphqlDefinition::GraphqlObjectTypeExtension(GraphqlObjectTypeExtension { - syntax, - }) - } - GRAPHQL_SCALAR_TYPE_DEFINITION => { - AnyGraphqlDefinition::GraphqlScalarTypeDefinition(GraphqlScalarTypeDefinition { - syntax, - }) - } - GRAPHQL_SCALAR_TYPE_EXTENSION => { - AnyGraphqlDefinition::GraphqlScalarTypeExtension(GraphqlScalarTypeExtension { + GRAPHQL_OPERATION_DEFINITION => { + AnyGraphqlDefinition::GraphqlOperationDefinition(GraphqlOperationDefinition { syntax, }) } @@ -5956,22 +6040,20 @@ impl AstNode for AnyGraphqlDefinition { GRAPHQL_SCHEMA_EXTENSION => { AnyGraphqlDefinition::GraphqlSchemaExtension(GraphqlSchemaExtension { syntax }) } - GRAPHQL_UNION_TYPE_DEFINITION => { - AnyGraphqlDefinition::GraphqlUnionTypeDefinition(GraphqlUnionTypeDefinition { - syntax, - }) - } - GRAPHQL_UNION_TYPE_EXTENSION => { - AnyGraphqlDefinition::GraphqlUnionTypeExtension(GraphqlUnionTypeExtension { - syntax, - }) + GRAPHQL_SELECTION_SET => { + AnyGraphqlDefinition::GraphqlSelectionSet(GraphqlSelectionSet { syntax }) } _ => { - if let Some(any_graphql_operation_definition) = - AnyGraphqlOperationDefinition::cast(syntax) + if let Some(any_graphql_type_definition) = + AnyGraphqlTypeDefinition::cast(syntax.clone()) { - return Some(AnyGraphqlDefinition::AnyGraphqlOperationDefinition( - any_graphql_operation_definition, + return Some(AnyGraphqlDefinition::AnyGraphqlTypeDefinition( + any_graphql_type_definition, + )); + } + if let Some(any_graphql_type_extension) = AnyGraphqlTypeExtension::cast(syntax) { + return Some(AnyGraphqlDefinition::AnyGraphqlTypeExtension( + any_graphql_type_extension, )); } return None; @@ -5983,96 +6065,56 @@ impl AstNode for AnyGraphqlDefinition { match self { AnyGraphqlDefinition::GraphqlBogusDefinition(it) => &it.syntax, AnyGraphqlDefinition::GraphqlDirectiveDefinition(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlEnumTypeDefinition(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlEnumTypeExtension(it) => &it.syntax, AnyGraphqlDefinition::GraphqlFragmentDefinition(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlInputObjectTypeDefinition(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlInputObjectTypeExtension(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlInterfaceTypeDefinition(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlInterfaceTypeExtension(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlObjectTypeDefinition(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlObjectTypeExtension(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlScalarTypeDefinition(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlScalarTypeExtension(it) => &it.syntax, + AnyGraphqlDefinition::GraphqlOperationDefinition(it) => &it.syntax, AnyGraphqlDefinition::GraphqlSchemaDefinition(it) => &it.syntax, AnyGraphqlDefinition::GraphqlSchemaExtension(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlUnionTypeDefinition(it) => &it.syntax, - AnyGraphqlDefinition::GraphqlUnionTypeExtension(it) => &it.syntax, - AnyGraphqlDefinition::AnyGraphqlOperationDefinition(it) => it.syntax(), + AnyGraphqlDefinition::GraphqlSelectionSet(it) => &it.syntax, + AnyGraphqlDefinition::AnyGraphqlTypeDefinition(it) => it.syntax(), + AnyGraphqlDefinition::AnyGraphqlTypeExtension(it) => it.syntax(), } } fn into_syntax(self) -> SyntaxNode { match self { AnyGraphqlDefinition::GraphqlBogusDefinition(it) => it.syntax, AnyGraphqlDefinition::GraphqlDirectiveDefinition(it) => it.syntax, - AnyGraphqlDefinition::GraphqlEnumTypeDefinition(it) => it.syntax, - AnyGraphqlDefinition::GraphqlEnumTypeExtension(it) => it.syntax, AnyGraphqlDefinition::GraphqlFragmentDefinition(it) => it.syntax, - AnyGraphqlDefinition::GraphqlInputObjectTypeDefinition(it) => it.syntax, - AnyGraphqlDefinition::GraphqlInputObjectTypeExtension(it) => it.syntax, - AnyGraphqlDefinition::GraphqlInterfaceTypeDefinition(it) => it.syntax, - AnyGraphqlDefinition::GraphqlInterfaceTypeExtension(it) => it.syntax, - AnyGraphqlDefinition::GraphqlObjectTypeDefinition(it) => it.syntax, - AnyGraphqlDefinition::GraphqlObjectTypeExtension(it) => it.syntax, - AnyGraphqlDefinition::GraphqlScalarTypeDefinition(it) => it.syntax, - AnyGraphqlDefinition::GraphqlScalarTypeExtension(it) => it.syntax, + AnyGraphqlDefinition::GraphqlOperationDefinition(it) => it.syntax, AnyGraphqlDefinition::GraphqlSchemaDefinition(it) => it.syntax, AnyGraphqlDefinition::GraphqlSchemaExtension(it) => it.syntax, - AnyGraphqlDefinition::GraphqlUnionTypeDefinition(it) => it.syntax, - AnyGraphqlDefinition::GraphqlUnionTypeExtension(it) => it.syntax, - AnyGraphqlDefinition::AnyGraphqlOperationDefinition(it) => it.into_syntax(), + AnyGraphqlDefinition::GraphqlSelectionSet(it) => it.syntax, + AnyGraphqlDefinition::AnyGraphqlTypeDefinition(it) => it.into_syntax(), + AnyGraphqlDefinition::AnyGraphqlTypeExtension(it) => it.into_syntax(), } } } impl std::fmt::Debug for AnyGraphqlDefinition { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - AnyGraphqlDefinition::AnyGraphqlOperationDefinition(it) => std::fmt::Debug::fmt(it, f), + AnyGraphqlDefinition::AnyGraphqlTypeDefinition(it) => std::fmt::Debug::fmt(it, f), + AnyGraphqlDefinition::AnyGraphqlTypeExtension(it) => std::fmt::Debug::fmt(it, f), AnyGraphqlDefinition::GraphqlBogusDefinition(it) => std::fmt::Debug::fmt(it, f), AnyGraphqlDefinition::GraphqlDirectiveDefinition(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlDefinition::GraphqlEnumTypeDefinition(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlDefinition::GraphqlEnumTypeExtension(it) => std::fmt::Debug::fmt(it, f), AnyGraphqlDefinition::GraphqlFragmentDefinition(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlDefinition::GraphqlInputObjectTypeDefinition(it) => { - std::fmt::Debug::fmt(it, f) - } - AnyGraphqlDefinition::GraphqlInputObjectTypeExtension(it) => { - std::fmt::Debug::fmt(it, f) - } - AnyGraphqlDefinition::GraphqlInterfaceTypeDefinition(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlDefinition::GraphqlInterfaceTypeExtension(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlDefinition::GraphqlObjectTypeDefinition(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlDefinition::GraphqlObjectTypeExtension(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlDefinition::GraphqlScalarTypeDefinition(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlDefinition::GraphqlScalarTypeExtension(it) => std::fmt::Debug::fmt(it, f), + AnyGraphqlDefinition::GraphqlOperationDefinition(it) => std::fmt::Debug::fmt(it, f), AnyGraphqlDefinition::GraphqlSchemaDefinition(it) => std::fmt::Debug::fmt(it, f), AnyGraphqlDefinition::GraphqlSchemaExtension(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlDefinition::GraphqlUnionTypeDefinition(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlDefinition::GraphqlUnionTypeExtension(it) => std::fmt::Debug::fmt(it, f), + AnyGraphqlDefinition::GraphqlSelectionSet(it) => std::fmt::Debug::fmt(it, f), } } } impl From for SyntaxNode { fn from(n: AnyGraphqlDefinition) -> SyntaxNode { match n { - AnyGraphqlDefinition::AnyGraphqlOperationDefinition(it) => it.into(), + AnyGraphqlDefinition::AnyGraphqlTypeDefinition(it) => it.into(), + AnyGraphqlDefinition::AnyGraphqlTypeExtension(it) => it.into(), AnyGraphqlDefinition::GraphqlBogusDefinition(it) => it.into(), AnyGraphqlDefinition::GraphqlDirectiveDefinition(it) => it.into(), - AnyGraphqlDefinition::GraphqlEnumTypeDefinition(it) => it.into(), - AnyGraphqlDefinition::GraphqlEnumTypeExtension(it) => it.into(), AnyGraphqlDefinition::GraphqlFragmentDefinition(it) => it.into(), - AnyGraphqlDefinition::GraphqlInputObjectTypeDefinition(it) => it.into(), - AnyGraphqlDefinition::GraphqlInputObjectTypeExtension(it) => it.into(), - AnyGraphqlDefinition::GraphqlInterfaceTypeDefinition(it) => it.into(), - AnyGraphqlDefinition::GraphqlInterfaceTypeExtension(it) => it.into(), - AnyGraphqlDefinition::GraphqlObjectTypeDefinition(it) => it.into(), - AnyGraphqlDefinition::GraphqlObjectTypeExtension(it) => it.into(), - AnyGraphqlDefinition::GraphqlScalarTypeDefinition(it) => it.into(), - AnyGraphqlDefinition::GraphqlScalarTypeExtension(it) => it.into(), + AnyGraphqlDefinition::GraphqlOperationDefinition(it) => it.into(), AnyGraphqlDefinition::GraphqlSchemaDefinition(it) => it.into(), AnyGraphqlDefinition::GraphqlSchemaExtension(it) => it.into(), - AnyGraphqlDefinition::GraphqlUnionTypeDefinition(it) => it.into(), - AnyGraphqlDefinition::GraphqlUnionTypeExtension(it) => it.into(), + AnyGraphqlDefinition::GraphqlSelectionSet(it) => it.into(), } } } @@ -6155,25 +6197,25 @@ impl From for AnyGraphqlPrimitiveType { AnyGraphqlPrimitiveType::GraphqlListType(node) } } -impl From for AnyGraphqlPrimitiveType { - fn from(node: GraphqlNamedType) -> AnyGraphqlPrimitiveType { - AnyGraphqlPrimitiveType::GraphqlNamedType(node) +impl From for AnyGraphqlPrimitiveType { + fn from(node: GraphqlNameReference) -> AnyGraphqlPrimitiveType { + AnyGraphqlPrimitiveType::GraphqlNameReference(node) } } impl AstNode for AnyGraphqlPrimitiveType { type Language = Language; const KIND_SET: SyntaxKindSet = - GraphqlListType::KIND_SET.union(GraphqlNamedType::KIND_SET); + GraphqlListType::KIND_SET.union(GraphqlNameReference::KIND_SET); fn can_cast(kind: SyntaxKind) -> bool { - matches!(kind, GRAPHQL_LIST_TYPE | GRAPHQL_NAMED_TYPE) + matches!(kind, GRAPHQL_LIST_TYPE | GRAPHQL_NAME_REFERENCE) } fn cast(syntax: SyntaxNode) -> Option { let res = match syntax.kind() { GRAPHQL_LIST_TYPE => { AnyGraphqlPrimitiveType::GraphqlListType(GraphqlListType { syntax }) } - GRAPHQL_NAMED_TYPE => { - AnyGraphqlPrimitiveType::GraphqlNamedType(GraphqlNamedType { syntax }) + GRAPHQL_NAME_REFERENCE => { + AnyGraphqlPrimitiveType::GraphqlNameReference(GraphqlNameReference { syntax }) } _ => return None, }; @@ -6182,13 +6224,13 @@ impl AstNode for AnyGraphqlPrimitiveType { fn syntax(&self) -> &SyntaxNode { match self { AnyGraphqlPrimitiveType::GraphqlListType(it) => &it.syntax, - AnyGraphqlPrimitiveType::GraphqlNamedType(it) => &it.syntax, + AnyGraphqlPrimitiveType::GraphqlNameReference(it) => &it.syntax, } } fn into_syntax(self) -> SyntaxNode { match self { AnyGraphqlPrimitiveType::GraphqlListType(it) => it.syntax, - AnyGraphqlPrimitiveType::GraphqlNamedType(it) => it.syntax, + AnyGraphqlPrimitiveType::GraphqlNameReference(it) => it.syntax, } } } @@ -6196,7 +6238,7 @@ impl std::fmt::Debug for AnyGraphqlPrimitiveType { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { AnyGraphqlPrimitiveType::GraphqlListType(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlPrimitiveType::GraphqlNamedType(it) => std::fmt::Debug::fmt(it, f), + AnyGraphqlPrimitiveType::GraphqlNameReference(it) => std::fmt::Debug::fmt(it, f), } } } @@ -6204,7 +6246,7 @@ impl From for SyntaxNode { fn from(n: AnyGraphqlPrimitiveType) -> SyntaxNode { match n { AnyGraphqlPrimitiveType::GraphqlListType(it) => it.into(), - AnyGraphqlPrimitiveType::GraphqlNamedType(it) => it.into(), + AnyGraphqlPrimitiveType::GraphqlNameReference(it) => it.into(), } } } @@ -6386,6 +6428,290 @@ impl From for SyntaxElement { node.into() } } +impl From for AnyGraphqlTypeDefinition { + fn from(node: GraphqlEnumTypeDefinition) -> AnyGraphqlTypeDefinition { + AnyGraphqlTypeDefinition::GraphqlEnumTypeDefinition(node) + } +} +impl From for AnyGraphqlTypeDefinition { + fn from(node: GraphqlInputObjectTypeDefinition) -> AnyGraphqlTypeDefinition { + AnyGraphqlTypeDefinition::GraphqlInputObjectTypeDefinition(node) + } +} +impl From for AnyGraphqlTypeDefinition { + fn from(node: GraphqlInterfaceTypeDefinition) -> AnyGraphqlTypeDefinition { + AnyGraphqlTypeDefinition::GraphqlInterfaceTypeDefinition(node) + } +} +impl From for AnyGraphqlTypeDefinition { + fn from(node: GraphqlObjectTypeDefinition) -> AnyGraphqlTypeDefinition { + AnyGraphqlTypeDefinition::GraphqlObjectTypeDefinition(node) + } +} +impl From for AnyGraphqlTypeDefinition { + fn from(node: GraphqlScalarTypeDefinition) -> AnyGraphqlTypeDefinition { + AnyGraphqlTypeDefinition::GraphqlScalarTypeDefinition(node) + } +} +impl From for AnyGraphqlTypeDefinition { + fn from(node: GraphqlUnionTypeDefinition) -> AnyGraphqlTypeDefinition { + AnyGraphqlTypeDefinition::GraphqlUnionTypeDefinition(node) + } +} +impl AstNode for AnyGraphqlTypeDefinition { + type Language = Language; + const KIND_SET: SyntaxKindSet = GraphqlEnumTypeDefinition::KIND_SET + .union(GraphqlInputObjectTypeDefinition::KIND_SET) + .union(GraphqlInterfaceTypeDefinition::KIND_SET) + .union(GraphqlObjectTypeDefinition::KIND_SET) + .union(GraphqlScalarTypeDefinition::KIND_SET) + .union(GraphqlUnionTypeDefinition::KIND_SET); + fn can_cast(kind: SyntaxKind) -> bool { + matches!( + kind, + GRAPHQL_ENUM_TYPE_DEFINITION + | GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION + | GRAPHQL_INTERFACE_TYPE_DEFINITION + | GRAPHQL_OBJECT_TYPE_DEFINITION + | GRAPHQL_SCALAR_TYPE_DEFINITION + | GRAPHQL_UNION_TYPE_DEFINITION + ) + } + fn cast(syntax: SyntaxNode) -> Option { + let res = match syntax.kind() { + GRAPHQL_ENUM_TYPE_DEFINITION => { + AnyGraphqlTypeDefinition::GraphqlEnumTypeDefinition(GraphqlEnumTypeDefinition { + syntax, + }) + } + GRAPHQL_INPUT_OBJECT_TYPE_DEFINITION => { + AnyGraphqlTypeDefinition::GraphqlInputObjectTypeDefinition( + GraphqlInputObjectTypeDefinition { syntax }, + ) + } + GRAPHQL_INTERFACE_TYPE_DEFINITION => { + AnyGraphqlTypeDefinition::GraphqlInterfaceTypeDefinition( + GraphqlInterfaceTypeDefinition { syntax }, + ) + } + GRAPHQL_OBJECT_TYPE_DEFINITION => { + AnyGraphqlTypeDefinition::GraphqlObjectTypeDefinition(GraphqlObjectTypeDefinition { + syntax, + }) + } + GRAPHQL_SCALAR_TYPE_DEFINITION => { + AnyGraphqlTypeDefinition::GraphqlScalarTypeDefinition(GraphqlScalarTypeDefinition { + syntax, + }) + } + GRAPHQL_UNION_TYPE_DEFINITION => { + AnyGraphqlTypeDefinition::GraphqlUnionTypeDefinition(GraphqlUnionTypeDefinition { + syntax, + }) + } + _ => return None, + }; + Some(res) + } + fn syntax(&self) -> &SyntaxNode { + match self { + AnyGraphqlTypeDefinition::GraphqlEnumTypeDefinition(it) => &it.syntax, + AnyGraphqlTypeDefinition::GraphqlInputObjectTypeDefinition(it) => &it.syntax, + AnyGraphqlTypeDefinition::GraphqlInterfaceTypeDefinition(it) => &it.syntax, + AnyGraphqlTypeDefinition::GraphqlObjectTypeDefinition(it) => &it.syntax, + AnyGraphqlTypeDefinition::GraphqlScalarTypeDefinition(it) => &it.syntax, + AnyGraphqlTypeDefinition::GraphqlUnionTypeDefinition(it) => &it.syntax, + } + } + fn into_syntax(self) -> SyntaxNode { + match self { + AnyGraphqlTypeDefinition::GraphqlEnumTypeDefinition(it) => it.syntax, + AnyGraphqlTypeDefinition::GraphqlInputObjectTypeDefinition(it) => it.syntax, + AnyGraphqlTypeDefinition::GraphqlInterfaceTypeDefinition(it) => it.syntax, + AnyGraphqlTypeDefinition::GraphqlObjectTypeDefinition(it) => it.syntax, + AnyGraphqlTypeDefinition::GraphqlScalarTypeDefinition(it) => it.syntax, + AnyGraphqlTypeDefinition::GraphqlUnionTypeDefinition(it) => it.syntax, + } + } +} +impl std::fmt::Debug for AnyGraphqlTypeDefinition { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + AnyGraphqlTypeDefinition::GraphqlEnumTypeDefinition(it) => std::fmt::Debug::fmt(it, f), + AnyGraphqlTypeDefinition::GraphqlInputObjectTypeDefinition(it) => { + std::fmt::Debug::fmt(it, f) + } + AnyGraphqlTypeDefinition::GraphqlInterfaceTypeDefinition(it) => { + std::fmt::Debug::fmt(it, f) + } + AnyGraphqlTypeDefinition::GraphqlObjectTypeDefinition(it) => { + std::fmt::Debug::fmt(it, f) + } + AnyGraphqlTypeDefinition::GraphqlScalarTypeDefinition(it) => { + std::fmt::Debug::fmt(it, f) + } + AnyGraphqlTypeDefinition::GraphqlUnionTypeDefinition(it) => std::fmt::Debug::fmt(it, f), + } + } +} +impl From for SyntaxNode { + fn from(n: AnyGraphqlTypeDefinition) -> SyntaxNode { + match n { + AnyGraphqlTypeDefinition::GraphqlEnumTypeDefinition(it) => it.into(), + AnyGraphqlTypeDefinition::GraphqlInputObjectTypeDefinition(it) => it.into(), + AnyGraphqlTypeDefinition::GraphqlInterfaceTypeDefinition(it) => it.into(), + AnyGraphqlTypeDefinition::GraphqlObjectTypeDefinition(it) => it.into(), + AnyGraphqlTypeDefinition::GraphqlScalarTypeDefinition(it) => it.into(), + AnyGraphqlTypeDefinition::GraphqlUnionTypeDefinition(it) => it.into(), + } + } +} +impl From for SyntaxElement { + fn from(n: AnyGraphqlTypeDefinition) -> SyntaxElement { + let node: SyntaxNode = n.into(); + node.into() + } +} +impl From for AnyGraphqlTypeExtension { + fn from(node: GraphqlEnumTypeExtension) -> AnyGraphqlTypeExtension { + AnyGraphqlTypeExtension::GraphqlEnumTypeExtension(node) + } +} +impl From for AnyGraphqlTypeExtension { + fn from(node: GraphqlInputObjectTypeExtension) -> AnyGraphqlTypeExtension { + AnyGraphqlTypeExtension::GraphqlInputObjectTypeExtension(node) + } +} +impl From for AnyGraphqlTypeExtension { + fn from(node: GraphqlInterfaceTypeExtension) -> AnyGraphqlTypeExtension { + AnyGraphqlTypeExtension::GraphqlInterfaceTypeExtension(node) + } +} +impl From for AnyGraphqlTypeExtension { + fn from(node: GraphqlObjectTypeExtension) -> AnyGraphqlTypeExtension { + AnyGraphqlTypeExtension::GraphqlObjectTypeExtension(node) + } +} +impl From for AnyGraphqlTypeExtension { + fn from(node: GraphqlScalarTypeExtension) -> AnyGraphqlTypeExtension { + AnyGraphqlTypeExtension::GraphqlScalarTypeExtension(node) + } +} +impl From for AnyGraphqlTypeExtension { + fn from(node: GraphqlUnionTypeExtension) -> AnyGraphqlTypeExtension { + AnyGraphqlTypeExtension::GraphqlUnionTypeExtension(node) + } +} +impl AstNode for AnyGraphqlTypeExtension { + type Language = Language; + const KIND_SET: SyntaxKindSet = GraphqlEnumTypeExtension::KIND_SET + .union(GraphqlInputObjectTypeExtension::KIND_SET) + .union(GraphqlInterfaceTypeExtension::KIND_SET) + .union(GraphqlObjectTypeExtension::KIND_SET) + .union(GraphqlScalarTypeExtension::KIND_SET) + .union(GraphqlUnionTypeExtension::KIND_SET); + fn can_cast(kind: SyntaxKind) -> bool { + matches!( + kind, + GRAPHQL_ENUM_TYPE_EXTENSION + | GRAPHQL_INPUT_OBJECT_TYPE_EXTENSION + | GRAPHQL_INTERFACE_TYPE_EXTENSION + | GRAPHQL_OBJECT_TYPE_EXTENSION + | GRAPHQL_SCALAR_TYPE_EXTENSION + | GRAPHQL_UNION_TYPE_EXTENSION + ) + } + fn cast(syntax: SyntaxNode) -> Option { + let res = match syntax.kind() { + GRAPHQL_ENUM_TYPE_EXTENSION => { + AnyGraphqlTypeExtension::GraphqlEnumTypeExtension(GraphqlEnumTypeExtension { + syntax, + }) + } + GRAPHQL_INPUT_OBJECT_TYPE_EXTENSION => { + AnyGraphqlTypeExtension::GraphqlInputObjectTypeExtension( + GraphqlInputObjectTypeExtension { syntax }, + ) + } + GRAPHQL_INTERFACE_TYPE_EXTENSION => { + AnyGraphqlTypeExtension::GraphqlInterfaceTypeExtension( + GraphqlInterfaceTypeExtension { syntax }, + ) + } + GRAPHQL_OBJECT_TYPE_EXTENSION => { + AnyGraphqlTypeExtension::GraphqlObjectTypeExtension(GraphqlObjectTypeExtension { + syntax, + }) + } + GRAPHQL_SCALAR_TYPE_EXTENSION => { + AnyGraphqlTypeExtension::GraphqlScalarTypeExtension(GraphqlScalarTypeExtension { + syntax, + }) + } + GRAPHQL_UNION_TYPE_EXTENSION => { + AnyGraphqlTypeExtension::GraphqlUnionTypeExtension(GraphqlUnionTypeExtension { + syntax, + }) + } + _ => return None, + }; + Some(res) + } + fn syntax(&self) -> &SyntaxNode { + match self { + AnyGraphqlTypeExtension::GraphqlEnumTypeExtension(it) => &it.syntax, + AnyGraphqlTypeExtension::GraphqlInputObjectTypeExtension(it) => &it.syntax, + AnyGraphqlTypeExtension::GraphqlInterfaceTypeExtension(it) => &it.syntax, + AnyGraphqlTypeExtension::GraphqlObjectTypeExtension(it) => &it.syntax, + AnyGraphqlTypeExtension::GraphqlScalarTypeExtension(it) => &it.syntax, + AnyGraphqlTypeExtension::GraphqlUnionTypeExtension(it) => &it.syntax, + } + } + fn into_syntax(self) -> SyntaxNode { + match self { + AnyGraphqlTypeExtension::GraphqlEnumTypeExtension(it) => it.syntax, + AnyGraphqlTypeExtension::GraphqlInputObjectTypeExtension(it) => it.syntax, + AnyGraphqlTypeExtension::GraphqlInterfaceTypeExtension(it) => it.syntax, + AnyGraphqlTypeExtension::GraphqlObjectTypeExtension(it) => it.syntax, + AnyGraphqlTypeExtension::GraphqlScalarTypeExtension(it) => it.syntax, + AnyGraphqlTypeExtension::GraphqlUnionTypeExtension(it) => it.syntax, + } + } +} +impl std::fmt::Debug for AnyGraphqlTypeExtension { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + AnyGraphqlTypeExtension::GraphqlEnumTypeExtension(it) => std::fmt::Debug::fmt(it, f), + AnyGraphqlTypeExtension::GraphqlInputObjectTypeExtension(it) => { + std::fmt::Debug::fmt(it, f) + } + AnyGraphqlTypeExtension::GraphqlInterfaceTypeExtension(it) => { + std::fmt::Debug::fmt(it, f) + } + AnyGraphqlTypeExtension::GraphqlObjectTypeExtension(it) => std::fmt::Debug::fmt(it, f), + AnyGraphqlTypeExtension::GraphqlScalarTypeExtension(it) => std::fmt::Debug::fmt(it, f), + AnyGraphqlTypeExtension::GraphqlUnionTypeExtension(it) => std::fmt::Debug::fmt(it, f), + } + } +} +impl From for SyntaxNode { + fn from(n: AnyGraphqlTypeExtension) -> SyntaxNode { + match n { + AnyGraphqlTypeExtension::GraphqlEnumTypeExtension(it) => it.into(), + AnyGraphqlTypeExtension::GraphqlInputObjectTypeExtension(it) => it.into(), + AnyGraphqlTypeExtension::GraphqlInterfaceTypeExtension(it) => it.into(), + AnyGraphqlTypeExtension::GraphqlObjectTypeExtension(it) => it.into(), + AnyGraphqlTypeExtension::GraphqlScalarTypeExtension(it) => it.into(), + AnyGraphqlTypeExtension::GraphqlUnionTypeExtension(it) => it.into(), + } + } +} +impl From for SyntaxElement { + fn from(n: AnyGraphqlTypeExtension) -> SyntaxElement { + let node: SyntaxNode = n.into(); + node.into() + } +} impl From for AnyGraphqlValue { fn from(node: GraphqlBogusValue) -> AnyGraphqlValue { AnyGraphqlValue::GraphqlBogusValue(node) @@ -6431,9 +6757,9 @@ impl From for AnyGraphqlValue { AnyGraphqlValue::GraphqlStringValue(node) } } -impl From for AnyGraphqlValue { - fn from(node: GraphqlVariable) -> AnyGraphqlValue { - AnyGraphqlValue::GraphqlVariable(node) +impl From for AnyGraphqlValue { + fn from(node: GraphqlVariableReference) -> AnyGraphqlValue { + AnyGraphqlValue::GraphqlVariableReference(node) } } impl AstNode for AnyGraphqlValue { @@ -6447,7 +6773,7 @@ impl AstNode for AnyGraphqlValue { .union(GraphqlNullValue::KIND_SET) .union(GraphqlObjectValue::KIND_SET) .union(GraphqlStringValue::KIND_SET) - .union(GraphqlVariable::KIND_SET); + .union(GraphqlVariableReference::KIND_SET); fn can_cast(kind: SyntaxKind) -> bool { matches!( kind, @@ -6460,7 +6786,7 @@ impl AstNode for AnyGraphqlValue { | GRAPHQL_NULL_VALUE | GRAPHQL_OBJECT_VALUE | GRAPHQL_STRING_VALUE - | GRAPHQL_VARIABLE + | GRAPHQL_VARIABLE_REFERENCE ) } fn cast(syntax: SyntaxNode) -> Option { @@ -6480,7 +6806,9 @@ impl AstNode for AnyGraphqlValue { GRAPHQL_STRING_VALUE => { AnyGraphqlValue::GraphqlStringValue(GraphqlStringValue { syntax }) } - GRAPHQL_VARIABLE => AnyGraphqlValue::GraphqlVariable(GraphqlVariable { syntax }), + GRAPHQL_VARIABLE_REFERENCE => { + AnyGraphqlValue::GraphqlVariableReference(GraphqlVariableReference { syntax }) + } _ => return None, }; Some(res) @@ -6496,7 +6824,7 @@ impl AstNode for AnyGraphqlValue { AnyGraphqlValue::GraphqlNullValue(it) => &it.syntax, AnyGraphqlValue::GraphqlObjectValue(it) => &it.syntax, AnyGraphqlValue::GraphqlStringValue(it) => &it.syntax, - AnyGraphqlValue::GraphqlVariable(it) => &it.syntax, + AnyGraphqlValue::GraphqlVariableReference(it) => &it.syntax, } } fn into_syntax(self) -> SyntaxNode { @@ -6510,7 +6838,7 @@ impl AstNode for AnyGraphqlValue { AnyGraphqlValue::GraphqlNullValue(it) => it.syntax, AnyGraphqlValue::GraphqlObjectValue(it) => it.syntax, AnyGraphqlValue::GraphqlStringValue(it) => it.syntax, - AnyGraphqlValue::GraphqlVariable(it) => it.syntax, + AnyGraphqlValue::GraphqlVariableReference(it) => it.syntax, } } } @@ -6526,7 +6854,7 @@ impl std::fmt::Debug for AnyGraphqlValue { AnyGraphqlValue::GraphqlNullValue(it) => std::fmt::Debug::fmt(it, f), AnyGraphqlValue::GraphqlObjectValue(it) => std::fmt::Debug::fmt(it, f), AnyGraphqlValue::GraphqlStringValue(it) => std::fmt::Debug::fmt(it, f), - AnyGraphqlValue::GraphqlVariable(it) => std::fmt::Debug::fmt(it, f), + AnyGraphqlValue::GraphqlVariableReference(it) => std::fmt::Debug::fmt(it, f), } } } @@ -6542,7 +6870,7 @@ impl From for SyntaxNode { AnyGraphqlValue::GraphqlNullValue(it) => it.into(), AnyGraphqlValue::GraphqlObjectValue(it) => it.into(), AnyGraphqlValue::GraphqlStringValue(it) => it.into(), - AnyGraphqlValue::GraphqlVariable(it) => it.into(), + AnyGraphqlValue::GraphqlVariableReference(it) => it.into(), } } } @@ -6577,6 +6905,16 @@ impl std::fmt::Display for AnyGraphqlType { std::fmt::Display::fmt(self.syntax(), f) } } +impl std::fmt::Display for AnyGraphqlTypeDefinition { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self.syntax(), f) + } +} +impl std::fmt::Display for AnyGraphqlTypeExtension { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self.syntax(), f) + } +} impl std::fmt::Display for AnyGraphqlValue { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) @@ -6742,12 +7080,17 @@ impl std::fmt::Display for GraphqlListValue { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for GraphqlName { +impl std::fmt::Display for GraphqlLiteralName { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self.syntax(), f) + } +} +impl std::fmt::Display for GraphqlNameBinding { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for GraphqlNamedType { +impl std::fmt::Display for GraphqlNameReference { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) } @@ -6857,7 +7200,7 @@ impl std::fmt::Display for GraphqlUnionTypeExtension { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for GraphqlVariable { +impl std::fmt::Display for GraphqlVariableBinding { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) } @@ -6872,6 +7215,11 @@ impl std::fmt::Display for GraphqlVariableDefinitions { std::fmt::Display::fmt(self.syntax(), f) } } +impl std::fmt::Display for GraphqlVariableReference { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self.syntax(), f) + } +} #[derive(Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize))] pub struct GraphqlBogus { @@ -7793,7 +8141,7 @@ impl Serialize for GraphqlImplementsInterfaceList { } impl AstSeparatedList for GraphqlImplementsInterfaceList { type Language = Language; - type Node = GraphqlNamedType; + type Node = GraphqlNameReference; fn syntax_list(&self) -> &SyntaxList { &self.syntax_list } @@ -7808,15 +8156,15 @@ impl Debug for GraphqlImplementsInterfaceList { } } impl IntoIterator for GraphqlImplementsInterfaceList { - type Item = SyntaxResult; - type IntoIter = AstSeparatedListNodesIterator; + type Item = SyntaxResult; + type IntoIter = AstSeparatedListNodesIterator; fn into_iter(self) -> Self::IntoIter { self.iter() } } impl IntoIterator for &GraphqlImplementsInterfaceList { - type Item = SyntaxResult; - type IntoIter = AstSeparatedListNodesIterator; + type Item = SyntaxResult; + type IntoIter = AstSeparatedListNodesIterator; fn into_iter(self) -> Self::IntoIter { self.iter() } @@ -8292,7 +8640,7 @@ impl Serialize for GraphqlUnionMemberTypeList { } impl AstSeparatedList for GraphqlUnionMemberTypeList { type Language = Language; - type Node = GraphqlNamedType; + type Node = GraphqlNameReference; fn syntax_list(&self) -> &SyntaxList { &self.syntax_list } @@ -8307,15 +8655,15 @@ impl Debug for GraphqlUnionMemberTypeList { } } impl IntoIterator for GraphqlUnionMemberTypeList { - type Item = SyntaxResult; - type IntoIter = AstSeparatedListNodesIterator; + type Item = SyntaxResult; + type IntoIter = AstSeparatedListNodesIterator; fn into_iter(self) -> Self::IntoIter { self.iter() } } impl IntoIterator for &GraphqlUnionMemberTypeList { - type Item = SyntaxResult; - type IntoIter = AstSeparatedListNodesIterator; + type Item = SyntaxResult; + type IntoIter = AstSeparatedListNodesIterator; fn into_iter(self) -> Self::IntoIter { self.iter() } diff --git a/crates/biome_graphql_syntax/src/generated/nodes_mut.rs b/crates/biome_graphql_syntax/src/generated/nodes_mut.rs index 32813e8c3118..801f60feac2d 100644 --- a/crates/biome_graphql_syntax/src/generated/nodes_mut.rs +++ b/crates/biome_graphql_syntax/src/generated/nodes_mut.rs @@ -4,7 +4,7 @@ use crate::{generated::nodes::*, GraphqlSyntaxToken as SyntaxToken}; use biome_rowan::AstNode; use std::iter::once; impl GraphqlAlias { - pub fn with_value(self, element: GraphqlName) -> Self { + pub fn with_value(self, element: GraphqlLiteralName) -> Self { Self::unwrap_cast( self.syntax .splice_slots(0usize..=0usize, once(Some(element.into_syntax().into()))), @@ -18,7 +18,7 @@ impl GraphqlAlias { } } impl GraphqlArgument { - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlLiteralName) -> Self { Self::unwrap_cast( self.syntax .splice_slots(0usize..=0usize, once(Some(element.into_syntax().into()))), @@ -114,7 +114,7 @@ impl GraphqlDirective { .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameReference) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -146,7 +146,7 @@ impl GraphqlDirectiveDefinition { .splice_slots(2usize..=2usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameBinding) -> Self { Self::unwrap_cast( self.syntax .splice_slots(3usize..=3usize, once(Some(element.into_syntax().into()))), @@ -204,7 +204,7 @@ impl GraphqlEnumTypeDefinition { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameBinding) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -236,7 +236,7 @@ impl GraphqlEnumTypeExtension { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameReference) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -256,7 +256,7 @@ impl GraphqlEnumTypeExtension { } } impl GraphqlEnumValue { - pub fn with_graphql_name(self, element: GraphqlName) -> Self { + pub fn with_value(self, element: GraphqlLiteralName) -> Self { Self::unwrap_cast( self.syntax .splice_slots(0usize..=0usize, once(Some(element.into_syntax().into()))), @@ -270,7 +270,7 @@ impl GraphqlEnumValueDefinition { once(element.map(|element| element.into_syntax().into())), )) } - pub fn with_value(self, element: GraphqlEnumValue) -> Self { + pub fn with_value(self, element: GraphqlLiteralName) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -310,7 +310,7 @@ impl GraphqlField { once(element.map(|element| element.into_syntax().into())), )) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlLiteralName) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -342,7 +342,7 @@ impl GraphqlFieldDefinition { once(element.map(|element| element.into_syntax().into())), )) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlLiteralName) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -408,7 +408,7 @@ impl GraphqlFragmentDefinition { .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameBinding) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -440,7 +440,7 @@ impl GraphqlFragmentSpread { .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameReference) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -532,7 +532,7 @@ impl GraphqlInputObjectTypeDefinition { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameBinding) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -564,7 +564,7 @@ impl GraphqlInputObjectTypeExtension { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameReference) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -590,7 +590,7 @@ impl GraphqlInputValueDefinition { once(element.map(|element| element.into_syntax().into())), )) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlLiteralName) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -642,7 +642,7 @@ impl GraphqlInterfaceTypeDefinition { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameBinding) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -680,7 +680,7 @@ impl GraphqlInterfaceTypeExtension { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameReference) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -745,7 +745,7 @@ impl GraphqlListValue { ) } } -impl GraphqlName { +impl GraphqlLiteralName { pub fn with_value_token(self, element: SyntaxToken) -> Self { Self::unwrap_cast( self.syntax @@ -753,11 +753,19 @@ impl GraphqlName { ) } } -impl GraphqlNamedType { - pub fn with_name(self, element: GraphqlName) -> Self { +impl GraphqlNameBinding { + pub fn with_value_token(self, element: SyntaxToken) -> Self { Self::unwrap_cast( self.syntax - .splice_slots(0usize..=0usize, once(Some(element.into_syntax().into()))), + .splice_slots(0usize..=0usize, once(Some(element.into()))), + ) + } +} +impl GraphqlNameReference { + pub fn with_value_token(self, element: SyntaxToken) -> Self { + Self::unwrap_cast( + self.syntax + .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } } @@ -784,7 +792,7 @@ impl GraphqlNullValue { } } impl GraphqlObjectField { - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlLiteralName) -> Self { Self::unwrap_cast( self.syntax .splice_slots(0usize..=0usize, once(Some(element.into_syntax().into()))), @@ -816,7 +824,7 @@ impl GraphqlObjectTypeDefinition { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameBinding) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -854,7 +862,7 @@ impl GraphqlObjectTypeExtension { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameReference) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -906,7 +914,7 @@ impl GraphqlOperationDefinition { .splice_slots(0usize..=0usize, once(Some(element.into_syntax().into()))), ) } - pub fn with_name(self, element: Option) -> Self { + pub fn with_name(self, element: Option) -> Self { Self::unwrap_cast(self.syntax.splice_slots( 1usize..=1usize, once(element.map(|element| element.into_syntax().into())), @@ -972,7 +980,7 @@ impl GraphqlRootOperationTypeDefinition { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_named_type(self, element: GraphqlNamedType) -> Self { + pub fn with_named_type(self, element: GraphqlNameReference) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -1012,7 +1020,7 @@ impl GraphqlScalarTypeDefinition { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameBinding) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -1038,7 +1046,7 @@ impl GraphqlScalarTypeExtension { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameReference) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -1138,7 +1146,7 @@ impl GraphqlTypeCondition { .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } - pub fn with_ty(self, element: GraphqlNamedType) -> Self { + pub fn with_ty(self, element: GraphqlNameReference) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -1178,7 +1186,7 @@ impl GraphqlUnionTypeDefinition { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameBinding) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -1210,7 +1218,7 @@ impl GraphqlUnionTypeExtension { .splice_slots(1usize..=1usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlNameReference) -> Self { Self::unwrap_cast( self.syntax .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), @@ -1229,14 +1237,14 @@ impl GraphqlUnionTypeExtension { )) } } -impl GraphqlVariable { +impl GraphqlVariableBinding { pub fn with_dollar_token(self, element: SyntaxToken) -> Self { Self::unwrap_cast( self.syntax .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: GraphqlName) -> Self { + pub fn with_name(self, element: GraphqlLiteralName) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -1244,7 +1252,7 @@ impl GraphqlVariable { } } impl GraphqlVariableDefinition { - pub fn with_variable(self, element: GraphqlVariable) -> Self { + pub fn with_variable(self, element: GraphqlVariableBinding) -> Self { Self::unwrap_cast( self.syntax .splice_slots(0usize..=0usize, once(Some(element.into_syntax().into()))), @@ -1295,3 +1303,17 @@ impl GraphqlVariableDefinitions { ) } } +impl GraphqlVariableReference { + pub fn with_dollar_token(self, element: SyntaxToken) -> Self { + Self::unwrap_cast( + self.syntax + .splice_slots(0usize..=0usize, once(Some(element.into()))), + ) + } + pub fn with_name(self, element: GraphqlLiteralName) -> Self { + Self::unwrap_cast( + self.syntax + .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), + ) + } +} diff --git a/crates/biome_graphql_syntax/src/lib.rs b/crates/biome_graphql_syntax/src/lib.rs index 46978c76f952..4c1db2535386 100644 --- a/crates/biome_graphql_syntax/src/lib.rs +++ b/crates/biome_graphql_syntax/src/lib.rs @@ -9,6 +9,7 @@ pub mod string_value_ext; mod syntax_node; use biome_rowan::{AstNode, RawSyntaxKind, SyntaxKind}; + pub use biome_rowan::{TextLen, TextRange, TextSize, TokenAtOffset, TriviaPieceKind, WalkEvent}; pub use file_source::GraphqlFileSource; pub use generated::*; diff --git a/xtask/codegen/graphql.ungram b/xtask/codegen/graphql.ungram index e036f4818cc9..a0f1865b4c64 100644 --- a/xtask/codegen/graphql.ungram +++ b/xtask/codegen/graphql.ungram @@ -43,7 +43,9 @@ GraphqlBogusSelection = SyntaxElement* GraphqlBogusValue = SyntaxElement* GraphqlBogusType = SyntaxElement* -GraphqlName = value: 'graphql_name' +GraphqlLiteralName = value: 'ident' +GraphqlNameBinding = value: 'ident' +GraphqlNameReference = value: 'ident' GraphqlRoot = bom: 'UNICODE_BOM'? @@ -53,21 +55,26 @@ GraphqlRoot = GraphqlDefinitionList = AnyGraphqlDefinition* AnyGraphqlDefinition = - AnyGraphqlOperationDefinition + GraphqlOperationDefinition + | GraphqlSelectionSet | GraphqlFragmentDefinition | GraphqlDirectiveDefinition | GraphqlSchemaDefinition - // Type Definitions - | GraphqlScalarTypeDefinition + | GraphqlSchemaExtension + | AnyGraphqlTypeDefinition + | AnyGraphqlTypeExtension + | GraphqlBogusDefinition + +AnyGraphqlTypeDefinition = + GraphqlScalarTypeDefinition | GraphqlObjectTypeDefinition | GraphqlInterfaceTypeDefinition | GraphqlUnionTypeDefinition | GraphqlEnumTypeDefinition | GraphqlInputObjectTypeDefinition - | GraphqlBogusDefinition - // Type System Extensions: we may possible want to group those in an enum outside of 'Definition' - | GraphqlSchemaExtension - | GraphqlScalarTypeExtension + +AnyGraphqlTypeExtension = + GraphqlScalarTypeExtension | GraphqlObjectTypeExtension | GraphqlInterfaceTypeExtension | GraphqlUnionTypeExtension @@ -81,7 +88,7 @@ AnyGraphqlOperationDefinition = GraphqlOperationDefinition | GraphqlSelectionSet // https://spec.graphql.org/October2021/#sec-Language.Operations GraphqlOperationDefinition = type: GraphqlOperationType - name: GraphqlName? + name: GraphqlNameBinding? variables: GraphqlVariableDefinitions? directives: GraphqlDirectiveList selection_set: GraphqlSelectionSet @@ -111,7 +118,7 @@ AnyGraphqlSelection = // https://spec.graphql.org/October2021/#sec-Language.Fields GraphqlField = alias: GraphqlAlias? - name: GraphqlName + name: GraphqlLiteralName arguments: GraphqlArguments? directives: GraphqlDirectiveList selection_set: GraphqlSelectionSet? @@ -120,7 +127,7 @@ GraphqlField = // ^^^ // https://spec.graphql.org/October2021/#Alias GraphqlAlias = - value: GraphqlName + value: GraphqlLiteralName ':' // { b(c: d) } @@ -137,7 +144,7 @@ GraphqlArgumentList = GraphqlArgument* // ^^^^ // https://spec.graphql.org/October2021/#sec-Language.Arguments GraphqlArgument = - name: GraphqlName + name: GraphqlLiteralName ':' value: AnyGraphqlValue @@ -146,7 +153,7 @@ GraphqlArgument = // https://spec.graphql.org/October2021/#sec-Language.Fragments GraphqlFragmentSpread = '...' - name: GraphqlName + name: GraphqlNameReference directives: GraphqlDirectiveList // { ... on A { b } } @@ -162,17 +169,17 @@ GraphqlInlineFragment = // https://spec.graphql.org/October2021/#sec-Language.Fragments GraphqlFragmentDefinition = 'fragment' - name: GraphqlName + name: GraphqlNameBinding type_condition: GraphqlTypeCondition directives: GraphqlDirectiveList selection_set: GraphqlSelectionSet GraphqlTypeCondition = 'on' - type: GraphqlNamedType + type: GraphqlNameReference AnyGraphqlValue = - GraphqlVariable + GraphqlVariableReference | GraphqlStringValue | GraphqlFloatValue | GraphqlIntValue @@ -199,7 +206,7 @@ GraphqlBooleanValue = value_token: ('true' | 'false') GraphqlNullValue = 'null' // https://spec.graphql.org/October2021/#sec-Enum-Value -GraphqlEnumValue = GraphqlName +GraphqlEnumValue = value: GraphqlLiteralName // https://spec.graphql.org/October2021/#sec-List-Value GraphqlListValue = @@ -219,7 +226,7 @@ GraphqlObjectValueMemberList = GraphqlObjectField* // https://spec.graphql.org/October2021/#ObjectField GraphqlObjectField = - name: GraphqlName + name: GraphqlLiteralName ':' value: AnyGraphqlValue @@ -234,16 +241,21 @@ GraphqlVariableDefinitionList = GraphqlVariableDefinition* // $episode: Episode = JEDI // https://spec.graphql.org/October2021/#VariableDefinition GraphqlVariableDefinition = - variable: GraphqlVariable + variable: GraphqlVariableBinding ':' type: AnyGraphqlType default: GraphqlDefaultValue? directives: GraphqlDirectiveList // https://spec.graphql.org/October2021/#Variable -GraphqlVariable = +GraphqlVariableBinding = '$' - name: GraphqlName + name: GraphqlLiteralName + +// https://spec.graphql.org/October2021/#Variable +GraphqlVariableReference = + '$' + name: GraphqlLiteralName // https://spec.graphql.org/October2021/#DefaultValue GraphqlDefaultValue = @@ -256,12 +268,7 @@ AnyGraphqlType = | GraphqlNonNullType | GraphqlBogusType -AnyGraphqlPrimitiveType = GraphqlNamedType | GraphqlListType - -// nullable, like String -// https://spec.graphql.org/October2021/#NamedType -GraphqlNamedType = - name: GraphqlName +AnyGraphqlPrimitiveType = GraphqlNameReference | GraphqlListType // nullable, [String] // https://spec.graphql.org/October2021/#ListType @@ -286,7 +293,7 @@ GraphqlDirectiveList = // https://spec.graphql.org/October2021/#Directive GraphqlDirective = '@' - name: GraphqlName + name: GraphqlNameReference arguments: GraphqlArguments? // "abc" schema {query: Query} @@ -321,7 +328,7 @@ GraphqlRootOperationTypes = GraphqlRootOperationTypeDefinition = operation_type: GraphqlOperationType ':' - named_type: GraphqlNamedType + named_type: GraphqlNameReference // "abc" schema {query: Query} // ^^^^^ @@ -332,14 +339,14 @@ GraphqlDescription = GraphqlScalarTypeDefinition = description: GraphqlDescription? 'scalar' - name: GraphqlName + name: GraphqlNameBinding directives: GraphqlDirectiveList // https://spec.graphql.org/October2021/#sec-Scalar-Extensions GraphqlScalarTypeExtension = 'extend' 'scalar' - name: GraphqlName + name: GraphqlNameReference directives: GraphqlDirectiveList // type A implements B {c: d} @@ -347,7 +354,7 @@ GraphqlScalarTypeExtension = GraphqlObjectTypeDefinition = description: GraphqlDescription? 'type' - name: GraphqlName + name: GraphqlNameBinding implements: GraphqlImplementsInterfaces? directives: GraphqlDirectiveList fields: GraphqlFieldsDefinition? @@ -357,7 +364,7 @@ GraphqlObjectTypeDefinition = GraphqlObjectTypeExtension = 'extend' 'type' - name: GraphqlName + name: GraphqlNameReference implements: GraphqlImplementsInterfaces? directives: GraphqlDirectiveList fields: GraphqlFieldsDefinition? @@ -372,7 +379,7 @@ GraphqlImplementsInterfaces = interfaces: GraphqlImplementsInterfaceList // A & B & C -GraphqlImplementsInterfaceList = (GraphqlNamedType ('&' GraphqlNamedType)*) +GraphqlImplementsInterfaceList = (GraphqlNameReference ('&' GraphqlNameReference)*) // type A implements B {c: d} // ^^^^^^ @@ -387,7 +394,7 @@ GraphqlFieldDefinitionList = GraphqlFieldDefinition* // https://spec.graphql.org/October2021/#FieldDefinition GraphqlFieldDefinition = description: GraphqlDescription? - name: GraphqlName + name: GraphqlLiteralName arguments: GraphqlArgumentsDefinition? ':' type: AnyGraphqlType @@ -407,7 +414,7 @@ GraphqlArgumentDefinitionList = GraphqlInputValueDefinition* // https://spec.graphql.org/October2021/#InputValueDefinition GraphqlInputValueDefinition = description: GraphqlDescription? - name: GraphqlName + name: GraphqlLiteralName ':' type: AnyGraphqlType default: GraphqlDefaultValue? @@ -418,7 +425,7 @@ GraphqlInputValueDefinition = GraphqlInterfaceTypeDefinition = description: GraphqlDescription? 'interface' - name: GraphqlName + name: GraphqlNameBinding implements: GraphqlImplementsInterfaces? directives: GraphqlDirectiveList fields: GraphqlFieldsDefinition? @@ -428,7 +435,7 @@ GraphqlInterfaceTypeDefinition = GraphqlInterfaceTypeExtension = 'extend' 'interface' - name: GraphqlName + name: GraphqlNameReference implements: GraphqlImplementsInterfaces? directives: GraphqlDirectiveList fields: GraphqlFieldsDefinition? @@ -440,7 +447,7 @@ GraphqlInterfaceTypeExtension = GraphqlUnionTypeDefinition = description: GraphqlDescription? 'union' - name: GraphqlName + name: GraphqlNameBinding directives: GraphqlDirectiveList union_members: GraphqlUnionMemberTypes? @@ -451,14 +458,14 @@ GraphqlUnionMemberTypes = members: GraphqlUnionMemberTypeList // A | B | C -GraphqlUnionMemberTypeList = (GraphqlNamedType ('|' GraphqlNamedType)*) +GraphqlUnionMemberTypeList = (GraphqlNameReference ('|' GraphqlNameReference)*) // https://spec.graphql.org/October2021/#sec-Union-Extensions // extend union A @d GraphqlUnionTypeExtension = 'extend' 'union' - name: GraphqlName + name: GraphqlNameReference directives: GraphqlDirectiveList union_members: GraphqlUnionMemberTypes? @@ -470,7 +477,7 @@ GraphqlUnionTypeExtension = GraphqlEnumTypeDefinition = description: GraphqlDescription? 'enum' - name: GraphqlName + name: GraphqlNameBinding directives: GraphqlDirectiveList enum_values: GraphqlEnumValuesDefinition? @@ -489,7 +496,7 @@ GraphqlEnumValueList = GraphqlEnumValueDefinition* // https://spec.graphql.org/October2021/#EnumValueDefinition GraphqlEnumValueDefinition = description: GraphqlDescription? - value: GraphqlEnumValue + value: GraphqlLiteralName directives: GraphqlDirectiveList // https://spec.graphql.org/October2021/#sec-Enum-Extensions @@ -497,7 +504,7 @@ GraphqlEnumValueDefinition = GraphqlEnumTypeExtension = 'extend' 'enum' - name: GraphqlName + name: GraphqlNameReference directives: GraphqlDirectiveList enum_values: GraphqlEnumValuesDefinition? @@ -506,7 +513,7 @@ GraphqlEnumTypeExtension = GraphqlInputObjectTypeDefinition = description: GraphqlDescription? 'input' - name: GraphqlName + name: GraphqlNameBinding directives: GraphqlDirectiveList input_fields: GraphqlInputFieldsDefinition? @@ -523,7 +530,7 @@ GraphqlInputFieldList = GraphqlInputValueDefinition* GraphqlInputObjectTypeExtension = 'extend' 'input' - name: GraphqlName + name: GraphqlNameReference directives: GraphqlDirectiveList input_fields: GraphqlInputFieldsDefinition? @@ -535,7 +542,7 @@ GraphqlDirectiveDefinition = description: GraphqlDescription? 'directive' '@' - name: GraphqlName + name: GraphqlNameBinding arguments: GraphqlArgumentsDefinition? 'repeatable'? 'on' diff --git a/xtask/codegen/src/graphql_kind_src.rs b/xtask/codegen/src/graphql_kind_src.rs index e8632af1959c..6b72725c47ee 100644 --- a/xtask/codegen/src/graphql_kind_src.rs +++ b/xtask/codegen/src/graphql_kind_src.rs @@ -66,12 +66,15 @@ pub const GRAPHQL_KINDS_SRC: KindsSrc = KindsSrc { "ERROR_TOKEN", "NEWLINE", "WHITESPACE", - "GRAPHQL_NAME", + "IDENT", "COMMENT", "COMMA", ], nodes: &[ "GRAPHQL_ROOT", + "GRAPHQL_LITERAL_NAME", + "GRAPHQL_NAME_BINDING", + "GRAPHQL_NAME_REFERENCE", "GRAPHQL_DEFINITION_LIST", "GRAPHQL_FRAGMENT_DEFINITION", "GRAPHQL_DIRECTIVE_DEFINITION", @@ -94,9 +97,9 @@ pub const GRAPHQL_KINDS_SRC: KindsSrc = KindsSrc { "GRAPHQL_ARGUMENT", "GRAPHQL_FRAGMENT_SPREAD", "GRAPHQL_INLINE_FRAGMENT", - "GRAPHQL_FRAGMENT_NAME", "GRAPHQL_TYPE_CONDITION", - "GRAPHQL_VARIABLE", + "GRAPHQL_VARIABLE_BINDING", + "GRAPHQL_VARIABLE_REFERENCE", "GRAPHQL_ENUM_VALUE", "GRAPHQL_LIST_VALUE", "GRAPHQL_LIST_VALUE_ELEMENT_LIST", @@ -108,7 +111,6 @@ pub const GRAPHQL_KINDS_SRC: KindsSrc = KindsSrc { "GRAPHQL_VARIABLE_DEFINITION", "GRAPHQL_DEFAULT_VALUE", "GRAPHQL_NON_NULL_TYPE", - "GRAPHQL_NAMED_TYPE", "GRAPHQL_LIST_TYPE", "GRAPHQL_DIRECTIVE_LIST", "GRAPHQL_DIRECTIVE",