@@ -106,6 +106,75 @@ def puts_arguments_on_multiple_lines_if_line_has_more_than_80_chars():
106
106
"""
107
107
)
108
108
109
+ def puts_large_object_values_on_multiple_lines_if_line_has_more_than_80_chars ():
110
+ printed = print_ast (
111
+ parse (
112
+ "{trip(obj:{wheelchair:false,smallObj:{a: 1},largeObj:"
113
+ "{wheelchair:false,smallObj:{a: 1},arriveBy:false,"
114
+ "includePlannedCancellations:true,transitDistanceReluctance:2000,"
115
+ 'anotherLongFieldName:"Lots and lots and lots and lots of text"},'
116
+ "arriveBy:false,includePlannedCancellations:true,"
117
+ "transitDistanceReluctance:2000,anotherLongFieldName:"
118
+ '"Lots and lots and lots and lots of text"}){dateTime}}'
119
+ )
120
+ )
121
+
122
+ assert printed == dedent (
123
+ """
124
+ {
125
+ trip(
126
+ obj: {
127
+ wheelchair: false
128
+ smallObj: { a: 1 }
129
+ largeObj: {
130
+ wheelchair: false
131
+ smallObj: { a: 1 }
132
+ arriveBy: false
133
+ includePlannedCancellations: true
134
+ transitDistanceReluctance: 2000
135
+ anotherLongFieldName: "Lots and lots and lots and lots of text"
136
+ }
137
+ arriveBy: false
138
+ includePlannedCancellations: true
139
+ transitDistanceReluctance: 2000
140
+ anotherLongFieldName: "Lots and lots and lots and lots of text"
141
+ }
142
+ ) {
143
+ dateTime
144
+ }
145
+ }
146
+ """
147
+ )
148
+
149
+ def puts_large_list_values_on_multiple_lines_if_line_has_more_than_80_chars ():
150
+ printed = print_ast (
151
+ parse (
152
+ '{trip(list:[["small array", "small", "small"],'
153
+ ' ["Lots and lots and lots and lots of text",'
154
+ ' "Lots and lots and lots and lots of text",'
155
+ ' "Lots and lots and lots and lots of text"]]){dateTime}}'
156
+ )
157
+ )
158
+
159
+ assert printed == dedent (
160
+ """
161
+ {
162
+ trip(
163
+ list: [
164
+ ["small array", "small", "small"]
165
+ [
166
+ "Lots and lots and lots and lots of text"
167
+ "Lots and lots and lots and lots of text"
168
+ "Lots and lots and lots and lots of text"
169
+ ]
170
+ ]
171
+ ) {
172
+ dateTime
173
+ }
174
+ }
175
+ """
176
+ )
177
+
109
178
def legacy_prints_fragment_with_variable_directives ():
110
179
query_ast_with_variable_directive = parse (
111
180
"fragment Foo($foo: TestType @test) on TestType @testDirective { id }" ,
0 commit comments