@@ -110,10 +110,10 @@ describe('Printer: Query document', () => {
110
110
` ) ;
111
111
} ) ;
112
112
113
- it ( 'Legacy: prints fragment with variable directives' , ( ) => {
113
+ it ( 'prints fragment with variable directives' , ( ) => {
114
114
const queryASTWithVariableDirective = parse (
115
115
'fragment Foo($foo: TestType @test) on TestType @testDirective { id }' ,
116
- { allowLegacyFragmentVariables : true } ,
116
+ { allowFragmentArguments : true } ,
117
117
) ;
118
118
expect ( print ( queryASTWithVariableDirective ) ) . to . equal ( dedent `
119
119
fragment Foo($foo: TestType @test) on TestType @testDirective {
@@ -122,14 +122,14 @@ describe('Printer: Query document', () => {
122
122
` ) ;
123
123
} ) ;
124
124
125
- it ( 'Legacy: correctly prints fragment defined variables' , ( ) => {
125
+ it ( 'correctly prints fragment defined variables' , ( ) => {
126
126
const fragmentWithVariable = parse (
127
127
`
128
128
fragment Foo($a: ComplexType, $b: Boolean = false) on TestType {
129
129
id
130
130
}
131
131
` ,
132
- { allowLegacyFragmentVariables : true } ,
132
+ { allowFragmentArguments : true } ,
133
133
) ;
134
134
expect ( print ( fragmentWithVariable ) ) . to . equal ( dedent `
135
135
fragment Foo($a: ComplexType, $b: Boolean = false) on TestType {
@@ -138,6 +138,34 @@ describe('Printer: Query document', () => {
138
138
` ) ;
139
139
} ) ;
140
140
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
+
141
169
it ( 'prints kitchen sink without altering ast' , ( ) => {
142
170
const ast = parse ( kitchenSinkQuery , {
143
171
noLocation : true ,
0 commit comments