@@ -557,16 +557,27 @@ type Query {
557557@"directive @skip(""Skipped when true."" if: Boolean!, x: Some) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT" ,
558558@"directive @skip(
559559 ""Skipped when true.""
560- if: Boolean!, x: Some) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT" ) ]
560+ if: Boolean!, x: Some) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT" , true , true , false , false , 2 , SDLPrinterArgumentsMode . None ) ]
561561 [ InlineData ( 43 ,
562+ @"directive @skip(if: Boolean!, x: Some) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT" ,
563+ @"directive @skip(
564+ if: Boolean!,
565+ x: Some) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT" , true , true , false , false , 2 , SDLPrinterArgumentsMode . ForceNewLine ) ]
566+ [ InlineData ( 44 ,
567+ @"directive @skip(""Skipped when true."" if: Boolean!, x: Some) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT" ,
568+ @"directive @skip(
569+ ""Skipped when true.""
570+ if: Boolean!,
571+ x: Some) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT" ) ]
572+ [ InlineData ( 45 ,
562573"""directive @skip("Skipped when true." if: Boolean!, "Second argument" x: Some) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT""" , """
563574directive @skip(
564575 "Skipped when true."
565576 if: Boolean!,
566577 "Second argument"
567578 x: Some) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
568579""" ) ]
569- [ InlineData ( 44 ,
580+ [ InlineData ( 46 ,
570581"schema { query: Q mutation: M subscription: S }" ,
571582"""
572583schema {
@@ -575,7 +586,7 @@ directive @skip(
575586 subscription: S
576587}
577588""" , true , true , false , false , 5 ) ]
578- [ InlineData ( 45 ,
589+ [ InlineData ( 47 ,
579590"""
580591"A component contains the parametric details of a PCB part."
581592input DesComponentFilterInput {
@@ -606,7 +617,7 @@ input DesComponentFilterInput {
606617 revision: DesRevisionFilterInput
607618}
608619""" ) ]
609- [ InlineData ( 46 ,
620+ [ InlineData ( 48 ,
610621"""
611622# comment
612623directive @my on FIELD
@@ -615,7 +626,7 @@ directive @my on FIELD
615626# comment
616627directive @my on FIELD
617628""" ) ]
618- [ InlineData ( 47 ,
629+ [ InlineData ( 49 ,
619630"""
620631query q
621632# comment
@@ -628,7 +639,7 @@ query q
628639 x
629640}
630641""" ) ]
631- [ InlineData ( 48 ,
642+ [ InlineData ( 50 ,
632643"""
633644query q
634645(
@@ -642,7 +653,7 @@ query q(
642653 x
643654}
644655""" ) ]
645- [ InlineData ( 49 ,
656+ [ InlineData ( 51 ,
646657"""
647658"description"
648659schema {
@@ -655,7 +666,7 @@ query q(
655666 query: Query
656667}
657668""" ) ]
658- [ InlineData ( 50 ,
669+ [ InlineData ( 52 ,
659670"""
660671type Query {
661672"Fetches an object given its ID."
@@ -691,7 +702,7 @@ type Query {
691702 id: ID!): DesWorkspace
692703}
693704""" ) ]
694- [ InlineData ( 51 ,
705+ [ InlineData ( 53 ,
695706"""
696707type Query {
697708 user
@@ -710,8 +721,50 @@ type Query {
710721 # comment 2
711722 id: ID!, name: Name!): Node
712723}
724+ """ , true , true , false , false , 2 , SDLPrinterArgumentsMode . None ) ]
725+ [ InlineData ( 54 ,
726+ """
727+ type Query {
728+ user
729+ # comment 1
730+ (
731+ # comment 2
732+ id: ID!
733+ name: Name!): Node
734+ }
735+ """ ,
736+ """
737+ type Query {
738+ user
739+ # comment 1
740+ (
741+ # comment 2
742+ id: ID!,
743+ name: Name!): Node
744+ }
745+ """ , true , true , false , false , 2 , SDLPrinterArgumentsMode . ForceNewLine ) ]
746+ [ InlineData ( 55 ,
747+ """
748+ type Query {
749+ user
750+ # comment 1
751+ (
752+ # comment 2
753+ id: ID!
754+ name: Name!): Node
755+ }
756+ """ ,
757+ """
758+ type Query {
759+ user
760+ # comment 1
761+ (
762+ # comment 2
763+ id: ID!,
764+ name: Name!): Node
765+ }
713766""" ) ]
714- [ InlineData ( 52 ,
767+ [ InlineData ( 56 ,
715768"""
716769directive @my
717770 # comment 1
@@ -726,7 +779,7 @@ directive @my
726779 # comment 2
727780 arg: Boolean!) on FIELD
728781""" ) ]
729- [ InlineData ( 53 ,
782+ [ InlineData ( 57 ,
730783"""
731784query Q {
732785 field1(arg1: 1) {
@@ -745,7 +798,7 @@ query Q {
745798 }
746799}
747800""" ) ]
748- [ InlineData ( 54 ,
801+ [ InlineData ( 58 ,
749802"""
750803query Q {
751804 field1
@@ -791,7 +844,7 @@ query Q {
791844 }
792845}
793846""" ) ]
794- [ InlineData ( 55 ,
847+ [ InlineData ( 59 ,
795848"""
796849fragment f
797850#comment
@@ -804,7 +857,7 @@ on Person {
804857 name
805858}
806859""" ) ]
807- [ InlineData ( 56 ,
860+ [ InlineData ( 60 ,
808861"""
809862type Person
810863#comment
@@ -817,7 +870,7 @@ implements Entity {
817870 name: String
818871}
819872""" ) ]
820- [ InlineData ( 57 ,
873+ [ InlineData ( 61 ,
821874"""
822875type Person
823876#comment
@@ -834,7 +887,7 @@ implements Entity &
834887 name: String
835888}
836889""" ) ]
837- [ InlineData ( 58 ,
890+ [ InlineData ( 62 ,
838891""""
839892"description"
840893type Person {
@@ -846,6 +899,28 @@ type Person {
846899 name: String
847900}
848901""" , false , false ) ]
902+ [ InlineData ( 63 , // https://github.com/graphql-dotnet/parser/issues/330
903+ """"
904+ type DesPcb {
905+ designItems("An optional array of designators to search." designators: [String!] "Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String where: DesDesignItemFilterInput): DesDesignItemConnection
906+ }
907+ """" ,
908+ """
909+ type DesPcb {
910+ designItems(
911+ "An optional array of designators to search."
912+ designators: [String!],
913+ "Returns the first _n_ elements from the list."
914+ first: Int,
915+ "Returns the elements in the list that come after the specified cursor."
916+ after: String,
917+ "Returns the last _n_ elements from the list."
918+ last: Int,
919+ "Returns the elements in the list that come before the specified cursor."
920+ before: String,
921+ where: DesDesignItemFilterInput): DesDesignItemConnection
922+ }
923+ """ ) ]
849924 public async Task SDLPrinter_Should_Print_Document (
850925 int number ,
851926 string text ,
@@ -854,7 +929,8 @@ public async Task SDLPrinter_Should_Print_Document(
854929 bool writeDescriptions = true ,
855930 bool eachDirectiveLocationOnNewLine = false ,
856931 bool eachUnionMemberOnNewLine = false ,
857- int indentSize = 2 )
932+ int indentSize = 2 ,
933+ SDLPrinterArgumentsMode mode = SDLPrinterArgumentsMode . PreferNewLine )
858934 {
859935 var printer = new SDLPrinter ( new SDLPrinterOptions
860936 {
@@ -863,6 +939,7 @@ public async Task SDLPrinter_Should_Print_Document(
863939 EachDirectiveLocationOnNewLine = eachDirectiveLocationOnNewLine ,
864940 EachUnionMemberOnNewLine = eachUnionMemberOnNewLine ,
865941 IndentSize = indentSize ,
942+ ArgumentsPrintMode = mode ,
866943 } ) ;
867944 var writer = new StringWriter ( ) ;
868945 var document = text . Parse ( ) ;
0 commit comments