This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree 3 files changed +7
-174
lines changed
app/code/Magento/GraphQl/etc
dev/tests/api-functional/testsuite/Magento/GraphQl/Framework
lib/internal/Magento/Framework/GraphQl/Query 3 files changed +7
-174
lines changed Original file line number Diff line number Diff line change 99
99
</type >
100
100
<type name =" Magento\Framework\GraphQl\Query\QueryComplexityLimiter" >
101
101
<arguments >
102
- <argument name =" queryDepth" xsi : type =" number" >50 </argument >
103
- <argument name =" queryComplexity" xsi : type =" number" >150 </argument >
102
+ <argument name =" queryDepth" xsi : type =" number" >10 </argument >
103
+ <argument name =" queryComplexity" xsi : type =" number" >50 </argument >
104
104
</arguments >
105
105
</type >
106
106
</config >
Original file line number Diff line number Diff line change @@ -86,109 +86,6 @@ public function testQueryComplexityIsLimited()
86
86
id
87
87
types
88
88
}
89
- categories {
90
- id
91
- position
92
- level
93
- url_key
94
- url_path
95
- product_count
96
- breadcrumbs {
97
- category_id
98
- category_name
99
- category_url_key
100
- }
101
- products {
102
- items {
103
- name
104
- special_from_date
105
- special_to_date
106
- new_to_date
107
- new_from_date
108
- tier_price
109
- manufacturer
110
- thumbnail
111
- sku
112
- image
113
- canonical_url
114
- updated_at
115
- created_at
116
- categories {
117
- id
118
- position
119
- level
120
- url_key
121
- url_path
122
- product_count
123
- breadcrumbs {
124
- category_id
125
- category_name
126
- category_url_key
127
- }
128
- products {
129
- items {
130
- name
131
- special_from_date
132
- special_to_date
133
- new_to_date
134
- new_from_date
135
- tier_price
136
- manufacturer
137
- sku
138
- image
139
- canonical_url
140
- updated_at
141
- created_at
142
- categories {
143
- id
144
- position
145
- level
146
- url_key
147
- url_path
148
- product_count
149
- breadcrumbs {
150
- category_id
151
- category_name
152
- category_url_key
153
- }
154
- products {
155
- items {
156
- name
157
- special_from_date
158
- special_to_date
159
- new_to_date
160
- new_from_date
161
- tier_price
162
- manufacturer
163
- sku
164
- image
165
- thumbnail
166
- canonical_url
167
- updated_at
168
- created_at
169
- categories {
170
- id
171
- position
172
- level
173
- url_key
174
- url_path
175
- product_count
176
- default_sort_by
177
- breadcrumbs {
178
- category_id
179
- category_name
180
- category_url_key
181
- }
182
- }
183
- }
184
- }
185
- }
186
- }
187
- }
188
- }
189
- }
190
- }
191
- }
192
89
}
193
90
}
194
91
}
@@ -201,7 +98,7 @@ public function testQueryComplexityIsLimited()
201
98
}
202
99
QUERY ;
203
100
204
- self ::expectExceptionMessageRegExp ('/Max query complexity should be 150 but got 151 / ' );
101
+ self ::expectExceptionMessageRegExp ('/Max query complexity should be 50 but got 62 / ' );
205
102
$ this ->graphQlQuery ($ query );
206
103
}
207
104
@@ -238,71 +135,7 @@ public function testQueryDepthIsLimited()
238
135
categories {
239
136
products {
240
137
items {
241
- categories {
242
- products {
243
- items {
244
- categories {
245
- products {
246
- items {
247
- categories {
248
- products {
249
- items {
250
- name,
251
- categories {
252
- products {
253
- items {
254
- categories {
255
- products {
256
- items {
257
- categories{
258
- products {
259
- items {
260
- categories {
261
- products {
262
- items {
263
- categories {
264
- products {
265
- items {
266
- categories {
267
- products {
268
- items {
269
- name,
270
- categories {
271
- products {
272
- items {
273
- categories {
274
- name
275
- }
276
- }
277
- }
278
- }
279
- }
280
- }
281
- }
282
- }
283
- }
284
- }
285
- }
286
- }
287
- }
288
- }
289
- }
290
- }
291
- }
292
- }
293
- }
294
- }
295
- }
296
- }
297
- }
298
- }
299
- }
300
- }
301
- }
302
- }
303
- }
304
- }
305
- }
138
+ name
306
139
}
307
140
}
308
141
}
@@ -326,7 +159,7 @@ public function testQueryDepthIsLimited()
326
159
}
327
160
}
328
161
QUERY ;
329
- self ::expectExceptionMessageRegExp ('/Max query depth should be 50 but got 51 / ' );
162
+ self ::expectExceptionMessageRegExp ('/Max query depth should be 10 but got 20 / ' );
330
163
$ this ->graphQlQuery ($ query );
331
164
}
332
165
}
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ class QueryComplexityLimiter
34
34
* @param int $queryComplexity
35
35
*/
36
36
public function __construct (
37
- int $ queryDepth = 50 ,
38
- int $ queryComplexity = 150
37
+ int $ queryDepth = 10 ,
38
+ int $ queryComplexity = 50
39
39
) {
40
40
$ this ->queryDepth = $ queryDepth ;
41
41
$ this ->queryComplexity = $ queryComplexity ;
You can’t perform that action at this time.
0 commit comments