There was an error while loading. Please reload this page.
1 parent f490f57 commit 3d43007Copy full SHA for 3d43007
1 file changed
packages/graphql/lib/src/links/cancellable_http_link/cancellable_http_link.dart
@@ -246,14 +246,15 @@ class CancellableHttpLink extends Link {
246
fileMap.isEmpty && useGETForQueries && _isQuery(request);
247
248
if (useGetForThisRequest) {
249
+ final params = _encodeAsUriParams(body);
250
+ final query = params['query'];
251
+ if (query != null) {
252
+ // collapse indentation so it doesn't bloat the GET URL
253
+ params['query'] = query.replaceAll(RegExp(r'\s+'), ' ').trim();
254
+ }
255
return http.AbortableRequest(
256
'GET',
- uri.replace(
- queryParameters: _encodeAttempter(
- request,
- _encodeAsUriParams,
- )(body),
- ),
257
+ uri.replace(queryParameters: params),
258
abortTrigger: abortTrigger,
259
)..headers.addAll(headers);
260
}
0 commit comments