@@ -208,13 +208,13 @@ public void Comments_on_Values_Should_Read_Correctly(IgnoreOptions options)
208
208
field . SelectionSet . Selections . Count . ShouldBe ( 1 ) ;
209
209
field . Arguments . Count . ShouldBe ( 9 ) ;
210
210
211
- var boolValue = field . Arguments [ 0 ] . Value . ShouldBeAssignableTo < GraphQLScalarValue > ( ) ;
211
+ var boolValue = field . Arguments [ 0 ] . Value . ShouldBeAssignableTo < GraphQLBooleanValue > ( ) ;
212
212
boolValue . Comment . ShouldNotBeNull ( ) . Text . ShouldBe ( "comment for bool" ) ;
213
213
214
- var nullValue = field . Arguments [ 1 ] . Value . ShouldBeAssignableTo < GraphQLScalarValue > ( ) ;
214
+ var nullValue = field . Arguments [ 1 ] . Value . ShouldBeAssignableTo < GraphQLNullValue > ( ) ;
215
215
nullValue . Comment . ShouldNotBeNull ( ) . Text . ShouldBe ( "comment for null" ) ;
216
216
217
- var enumValue = field . Arguments [ 2 ] . Value . ShouldBeAssignableTo < GraphQLScalarValue > ( ) ;
217
+ var enumValue = field . Arguments [ 2 ] . Value . ShouldBeAssignableTo < GraphQLEnumValue > ( ) ;
218
218
enumValue . Comment . ShouldNotBeNull ( ) . Text . ShouldBe ( "comment for enum" ) ;
219
219
220
220
var listValue = field . Arguments [ 3 ] . Value . ShouldBeAssignableTo < GraphQLListValue > ( ) ;
@@ -223,13 +223,13 @@ public void Comments_on_Values_Should_Read_Correctly(IgnoreOptions options)
223
223
var objValue = field . Arguments [ 4 ] . Value . ShouldBeAssignableTo < GraphQLObjectValue > ( ) ;
224
224
objValue . Comment . ShouldNotBeNull ( ) . Text . ShouldBe ( "comment for object" ) ;
225
225
226
- var intValue = field . Arguments [ 5 ] . Value . ShouldBeAssignableTo < GraphQLScalarValue > ( ) ;
226
+ var intValue = field . Arguments [ 5 ] . Value . ShouldBeAssignableTo < GraphQLIntValue > ( ) ;
227
227
intValue . Comment . ShouldNotBeNull ( ) . Text . ShouldBe ( "comment for int" ) ;
228
228
229
- var floatValue = field . Arguments [ 6 ] . Value . ShouldBeAssignableTo < GraphQLScalarValue > ( ) ;
229
+ var floatValue = field . Arguments [ 6 ] . Value . ShouldBeAssignableTo < GraphQLFloatValue > ( ) ;
230
230
floatValue . Comment . ShouldNotBeNull ( ) . Text . ShouldBe ( "comment for float" ) ;
231
231
232
- var stringValue = field . Arguments [ 7 ] . Value . ShouldBeAssignableTo < GraphQLScalarValue > ( ) ;
232
+ var stringValue = field . Arguments [ 7 ] . Value . ShouldBeAssignableTo < GraphQLStringValue > ( ) ;
233
233
stringValue . Comment . ShouldNotBeNull ( ) . Text . ShouldBe ( "comment for string" ) ;
234
234
235
235
var varValue = field . Arguments [ 8 ] . Value . ShouldBeAssignableTo < GraphQLVariable > ( ) ;
@@ -527,6 +527,18 @@ public void Should_Throw_On_Unknown_OperationType()
527
527
ex . Column . ShouldBe ( 1 ) ;
528
528
}
529
529
530
+ [ Theory ]
531
+ [ InlineData ( "enum E { true A }" , "Unexpected Name \" true\" ; enum values are represented as unquoted names but not 'true' or 'false' or 'null'." , 1 , 10 ) ]
532
+ [ InlineData ( "enum E { B false }" , "Unexpected Name \" false\" ; enum values are represented as unquoted names but not 'true' or 'false' or 'null'." , 1 , 12 ) ]
533
+ [ InlineData ( "enum E { A null B }" , "Unexpected Name \" null\" ; enum values are represented as unquoted names but not 'true' or 'false' or 'null'." , 1 , 12 ) ]
534
+ public void Should_Throw_On_Invalid_EnumValue ( string query , string description , int line , int column )
535
+ {
536
+ var ex = Should . Throw < GraphQLSyntaxErrorException > ( ( ) => query . Parse ( ) ) ;
537
+ ex . Description . ShouldBe ( description ) ;
538
+ ex . Line . ShouldBe ( line ) ;
539
+ ex . Column . ShouldBe ( column ) ;
540
+ }
541
+
530
542
[ Theory ]
531
543
[ InlineData ( IgnoreOptions . None ) ]
532
544
[ InlineData ( IgnoreOptions . Comments ) ]
@@ -825,7 +837,7 @@ public void Should_Parse_SpecifiedBy()
825
837
def . Directives [ 0 ] . Name . Value . ShouldBe ( "specifiedBy" ) ;
826
838
def . Directives [ 0 ] . Arguments . Count . ShouldBe ( 1 ) ;
827
839
def . Directives [ 0 ] . Arguments [ 0 ] . Name . Value . ShouldBe ( "url" ) ;
828
- var value = def . Directives [ 0 ] . Arguments [ 0 ] . Value . ShouldBeAssignableTo < GraphQLScalarValue > ( ) ;
840
+ var value = def . Directives [ 0 ] . Arguments [ 0 ] . Value . ShouldBeAssignableTo < GraphQLStringValue > ( ) ;
829
841
value . Value . ShouldBe ( "https://tools.ietf.org/html/rfc4122" ) ;
830
842
}
831
843
@@ -936,23 +948,23 @@ public void Should_Parse_Extensions(string text, ASTNodeKind kind)
936
948
}
937
949
938
950
[ Theory ]
939
- [ InlineData ( "extend" , "Unexpected EOF" ) ]
940
- [ InlineData ( "extend scalar" , "Expected Name, found EOF" ) ]
941
- [ InlineData ( "extend scalar A" , "Unexpected EOF" ) ]
942
- [ InlineData ( "extend scalar A B" , "Unexpected Name \" B\" " ) ]
943
- [ InlineData ( "extend type" , "Expected Name, found EOF" ) ]
944
- [ InlineData ( "extend type A" , "Unexpected EOF" ) ]
945
- [ InlineData ( "extend type A B" , "Unexpected Name \" B\" " ) ]
946
- [ InlineData ( "extend interface" , "Expected Name, found EOF" ) ]
947
- [ InlineData ( "extend interface A" , "Unexpected EOF" ) ]
948
- [ InlineData ( "extend interface A B" , "Unexpected Name \" B\" " ) ]
949
- [ InlineData ( "extend union" , "Expected Name, found EOF" ) ]
950
- [ InlineData ( "extend union A" , "Unexpected EOF" ) ]
951
- [ InlineData ( "extend enum" , "Expected Name, found EOF" ) ]
952
- [ InlineData ( "extend enum A" , "Unexpected EOF" ) ]
953
- [ InlineData ( "extend input" , "Expected Name, found EOF" ) ]
954
- [ InlineData ( "extend input A" , "Unexpected EOF" ) ]
955
- [ InlineData ( "extend variable" , "Unexpected Name \" variable\" " ) ]
951
+ [ InlineData ( "extend" , "Unexpected EOF; for more information see http://spec.graphql.org/October2021/#TypeExtension " ) ]
952
+ [ InlineData ( "extend scalar" , "Expected Name, found EOF; for more information see http://spec.graphql.org/October2021/#ScalarTypeExtension " ) ]
953
+ [ InlineData ( "extend scalar A" , "Unexpected EOF; for more information see http://spec.graphql.org/October2021/#ScalarTypeExtension " ) ]
954
+ [ InlineData ( "extend scalar A B" , "Unexpected Name \" B\" ; for more information see http://spec.graphql.org/October2021/#ScalarTypeExtension " ) ]
955
+ [ InlineData ( "extend type" , "Expected Name, found EOF; for more information see http://spec.graphql.org/October2021/#ObjectTypeExtension " ) ]
956
+ [ InlineData ( "extend type A" , "Unexpected EOF; for more information see http://spec.graphql.org/October2021/#ObjectTypeExtension " ) ]
957
+ [ InlineData ( "extend type A B" , "Unexpected Name \" B\" ; for more information see http://spec.graphql.org/October2021/#ObjectTypeExtension " ) ]
958
+ [ InlineData ( "extend interface" , "Expected Name, found EOF; for more information see http://spec.graphql.org/October2021/#InterfaceTypeExtension " ) ]
959
+ [ InlineData ( "extend interface A" , "Unexpected EOF; for more information see http://spec.graphql.org/October2021/#InterfaceTypeExtension " ) ]
960
+ [ InlineData ( "extend interface A B" , "Unexpected Name \" B\" ; for more information see http://spec.graphql.org/October2021/#InterfaceTypeExtension " ) ]
961
+ [ InlineData ( "extend union" , "Expected Name, found EOF; for more information see http://spec.graphql.org/October2021/#UnionTypeExtension " ) ]
962
+ [ InlineData ( "extend union A" , "Unexpected EOF; for more information see http://spec.graphql.org/October2021/#UnionTypeExtension " ) ]
963
+ [ InlineData ( "extend enum" , "Expected Name, found EOF; for more information see http://spec.graphql.org/October2021/#EnumTypeExtension " ) ]
964
+ [ InlineData ( "extend enum A" , "Unexpected EOF; for more information see http://spec.graphql.org/October2021/#EnumTypeExtension " ) ]
965
+ [ InlineData ( "extend input" , "Expected Name, found EOF; for more information see http://spec.graphql.org/October2021/#InputObjectTypeExtension " ) ]
966
+ [ InlineData ( "extend input A" , "Unexpected EOF; for more information see http://spec.graphql.org/October2021/#InputObjectTypeExtension " ) ]
967
+ [ InlineData ( "extend variable" , "Unexpected Name \" variable\" ; for more information see http://spec.graphql.org/October2021/#TypeExtension " ) ]
956
968
public void Should_Throw_Extensions ( string text , string description )
957
969
{
958
970
var ex = Should . Throw < GraphQLSyntaxErrorException > ( ( ) => text . Parse ( ) ) ;
0 commit comments