@@ -175,6 +175,17 @@ const printDocASTReducer = {
175
175
join ( [ 'input' , name , join ( directives , ' ' ) , block ( fields ) ] , ' ' ) ,
176
176
) ,
177
177
178
+ DirectiveDefinition : addDescription (
179
+ ( { name, arguments : args , locations } ) =>
180
+ 'directive @' +
181
+ name +
182
+ ( args . every ( arg => arg . indexOf ( '\n' ) === - 1 )
183
+ ? wrap ( '(' , join ( args , ', ' ) , ')' )
184
+ : wrap ( '(\n' , indent ( join ( args , '\n' ) ) , '\n)' ) ) +
185
+ ' on ' +
186
+ join ( locations , ' | ' ) ,
187
+ ) ,
188
+
178
189
SchemaExtension : ( { directives, operationTypes } ) =>
179
190
join ( [ 'extend schema' , join ( directives , ' ' ) , block ( operationTypes ) ] , ' ' ) ,
180
191
@@ -212,17 +223,6 @@ const printDocASTReducer = {
212
223
213
224
InputObjectTypeExtension : ( { name, directives, fields } ) =>
214
225
join ( [ 'extend input' , name , join ( directives , ' ' ) , block ( fields ) ] , ' ' ) ,
215
-
216
- DirectiveDefinition : addDescription (
217
- ( { name, arguments : args , locations } ) =>
218
- 'directive @' +
219
- name +
220
- ( args . every ( arg => arg . indexOf ( '\n' ) === - 1 )
221
- ? wrap ( '(' , join ( args , ', ' ) , ')' )
222
- : wrap ( '(\n' , indent ( join ( args , '\n' ) ) , '\n)' ) ) +
223
- ' on ' +
224
- join ( locations , ' | ' ) ,
225
- ) ,
226
226
} ;
227
227
228
228
function addDescription ( cb ) {
0 commit comments