File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed
Language/test/Language.SyntaxTree.Tests/Utilities
Mutable/test/Types.Mutable.Tests Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -716,6 +716,35 @@ public void Serialize_SchemaDefWithOpNoIndent_InOutShouldBeTheSame()
716716 Assert . Equal ( schema , result ) ;
717717 }
718718
719+ [ Fact ]
720+ public void Serialize_SchemaDefWithDescriptionAndOps_SchemaKeywordNotOmitted ( )
721+ {
722+ // arrange
723+ var schema =
724+ """
725+ "Example schema"
726+ schema {
727+ query: Query
728+ mutation: Mutation
729+ }
730+
731+ type Query {
732+ someField: String
733+ }
734+
735+ type Mutation {
736+ someMutation: String
737+ }
738+ """ ;
739+ var document = Utf8GraphQLParser . Parse ( schema ) ;
740+
741+ // act
742+ var result = document . ToString ( ) ;
743+
744+ // assert
745+ result . MatchInlineSnapshot ( schema ) ;
746+ }
747+
719748 [ Fact ]
720749 public void Serialize_SchemaDefWithOpNoIndent_OutHasIndentation ( )
721750 {
Original file line number Diff line number Diff line change @@ -293,4 +293,34 @@ input Bar {
293293 }
294294 """ ) ;
295295 }
296+
297+ [ Fact ]
298+ public void Format_Schema_With_Description_Schema_Keyword_Not_Omitted ( )
299+ {
300+ // arrange
301+ var sdl =
302+ """
303+ "Example schema"
304+ schema {
305+ query: Query
306+ mutation: Mutation
307+ }
308+
309+ type Query {
310+ someField: String
311+ }
312+
313+ type Mutation {
314+ someMutation: String
315+ }
316+ """ ;
317+
318+ var schema = SchemaParser . Parse ( Encoding . UTF8 . GetBytes ( sdl ) ) ;
319+
320+ // act
321+ var formattedSdl = SchemaFormatter . FormatAsString ( schema ) ;
322+
323+ // assert
324+ formattedSdl . MatchInlineSnapshot ( sdl ) ;
325+ }
296326}
You can’t perform that action at this time.
0 commit comments