@@ -823,15 +823,25 @@ mod tests {
823
823
#[ test]
824
824
fn test_parse_operation_variables ( ) {
825
825
// operation with variable definitions
826
- {
827
- let result = Operation :: new ( OperationType :: Query ,
828
- Some ( String :: from ( "likeStory" ) ) ,
829
- vec ! [ VariableDefinition :: new( String :: from( "storyID" ) ,
830
- Type :: Named ( String :: from( "Int" ) ) ,
831
- None ) ] ,
832
- Vec :: new ( ) ) ;
833
- assert_successful_parse ! ( OperationDefinition , "query likeStory($storyID: Int)" , result) ;
834
- }
826
+ let result = Operation :: new ( OperationType :: Query ,
827
+ Some ( String :: from ( "likeStory" ) ) ,
828
+ vec ! [ VariableDefinition :: new( String :: from( "storyID" ) ,
829
+ Type :: Named ( String :: from( "Int" ) ) ,
830
+ None ) ] ,
831
+ Vec :: new ( ) ) ;
832
+ assert_successful_parse ! ( OperationDefinition ,
833
+ "query likeStory($storyID: Int)" ,
834
+ result) ;
835
+ }
836
+
837
+ #[ test]
838
+ fn test_parse_operation_directives ( ) {
839
+ // operatin with directives
840
+ let result = Operation :: new ( OperationType :: Query ,
841
+ Some ( String :: from ( "likeStory" ) ) ,
842
+ Vec :: new ( ) ,
843
+ vec ! [ Directive :: new( String :: from( "dir" ) , Vec :: new( ) ) ] ) ;
844
+ assert_successful_parse ! ( OperationDefinition , "query likeStory @dir" , result) ;
835
845
}
836
846
837
847
#[ test]
0 commit comments