File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
src/HotChocolate/Language
test/Language.Tests/Parser Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public ref partial struct Utf8GraphQLRequestParser
12
12
case TokenKind . String :
13
13
if ( _reader . Value . Length == 0 )
14
14
{
15
+ _reader . MoveNext ( ) ;
15
16
return null ;
16
17
}
17
18
Original file line number Diff line number Diff line change @@ -661,6 +661,32 @@ public void Parse_Invalid_Query()
661
661
} ) ;
662
662
}
663
663
664
+ [ Fact ]
665
+ public void Parse_Empty_OperationName ( )
666
+ {
667
+ // arrange
668
+ var source = Encoding . UTF8 . GetBytes (
669
+ """
670
+ {
671
+ "operationName": "",
672
+ "query": "{}"
673
+ }
674
+ """ . NormalizeLineBreaks ( ) ) ;
675
+ var parserOptions = new ParserOptions ( ) ;
676
+ var requestParser = new Utf8GraphQLRequestParser (
677
+ source ,
678
+ parserOptions ,
679
+ new DocumentCache ( ) ,
680
+ new Sha256DocumentHashProvider ( ) ) ;
681
+
682
+ // act
683
+ var batch = requestParser . Parse ( ) ;
684
+
685
+ // assert
686
+ var request = Assert . Single ( batch ) ;
687
+ Assert . Null ( request . OperationName ) ;
688
+ }
689
+
664
690
[ Fact ]
665
691
public void Parse_Empty_Json ( )
666
692
{
You can’t perform that action at this time.
0 commit comments