@@ -110,10 +110,10 @@ describe('Printer: Query document', () => {
110110 ` ) ;
111111 } ) ;
112112
113- it ( 'Legacy: prints fragment with variable directives' , ( ) => {
113+ it ( 'prints fragment with variable directives' , ( ) => {
114114 const queryASTWithVariableDirective = parse (
115115 'fragment Foo($foo: TestType @test) on TestType @testDirective { id }' ,
116- { allowLegacyFragmentVariables : true } ,
116+ { allowFragmentArguments : true } ,
117117 ) ;
118118 expect ( print ( queryASTWithVariableDirective ) ) . to . equal ( dedent `
119119 fragment Foo($foo: TestType @test) on TestType @testDirective {
@@ -122,14 +122,14 @@ describe('Printer: Query document', () => {
122122 ` ) ;
123123 } ) ;
124124
125- it ( 'Legacy: correctly prints fragment defined variables' , ( ) => {
125+ it ( 'correctly prints fragment defined variables' , ( ) => {
126126 const fragmentWithVariable = parse (
127127 `
128128 fragment Foo($a: ComplexType, $b: Boolean = false) on TestType {
129129 id
130130 }
131131 ` ,
132- { allowLegacyFragmentVariables : true } ,
132+ { allowFragmentArguments : true } ,
133133 ) ;
134134 expect ( print ( fragmentWithVariable ) ) . to . equal ( dedent `
135135 fragment Foo($a: ComplexType, $b: Boolean = false) on TestType {
@@ -138,6 +138,34 @@ describe('Printer: Query document', () => {
138138 ` ) ;
139139 } ) ;
140140
141+ it ( 'prints fragment spread with arguments' , ( ) => {
142+ const queryASTWithVariableDirective = parse (
143+ 'fragment Foo on TestType { ...Bar(a: {x: $x}, b: true) }' ,
144+ { allowFragmentArguments : true } ,
145+ ) ;
146+ expect ( print ( queryASTWithVariableDirective ) ) . to . equal ( dedent `
147+ fragment Foo on TestType {
148+ ...Bar(a: {x: $x}, b: true)
149+ }
150+ ` ) ;
151+ } ) ;
152+
153+ it ( 'prints fragment spread with multi-line arguments' , ( ) => {
154+ const queryASTWithVariableDirective = parse (
155+ 'fragment Foo on TestType { ...Bar(a: {x: $x, y: $y, z: $z, xy: $xy}, b: true, c: "a long string extending arguments over max length") }' ,
156+ { allowFragmentArguments : true } ,
157+ ) ;
158+ expect ( print ( queryASTWithVariableDirective ) ) . to . equal ( dedent `
159+ fragment Foo on TestType {
160+ ...Bar(
161+ a: {x: $x, y: $y, z: $z, xy: $xy}
162+ b: true
163+ c: "a long string extending arguments over max length"
164+ )
165+ }
166+ ` ) ;
167+ } ) ;
168+
141169 it ( 'prints kitchen sink without altering ast' , ( ) => {
142170 const ast = parse ( kitchenSinkQuery , {
143171 noLocation : true ,
0 commit comments