From 1f74665c7e00b7b9f39aa450c73dd324cbb0f787 Mon Sep 17 00:00:00 2001 From: slim Date: Thu, 4 Jul 2024 12:55:31 +0100 Subject: [PATCH] fix: remove repeated non batch key (#2344) --- src/core/http/data_loader.rs | 6 +++++- tests/execution/batching-default.md | 2 +- tests/execution/batching-group-by-default.md | 2 +- tests/execution/batching-group-by.md | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/http/data_loader.rs b/src/core/http/data_loader.rs index 743929c8d8..4a66c80f29 100644 --- a/src/core/http/data_loader.rs +++ b/src/core/http/data_loader.rs @@ -76,7 +76,11 @@ impl Loader for HttpDataLoader { for key in &keys[1..] { let request = key.to_request(); let url = request.url(); - first_url.query_pairs_mut().extend_pairs(url.query_pairs()); + let pairs: Vec<_> = url + .query_pairs() + .filter(|(key, _)| group_by.path().contains(&key.to_string())) + .collect(); + first_url.query_pairs_mut().extend_pairs(pairs); } let res = self diff --git a/tests/execution/batching-default.md b/tests/execution/batching-default.md index 0793ba2683..83f8225d05 100644 --- a/tests/execution/batching-default.md +++ b/tests/execution/batching-default.md @@ -41,7 +41,7 @@ type User { userId: 2 - request: method: GET - url: http://jsonplaceholder.typicode.com/users?id=1&foo=bar&id=2&foo=bar + url: http://jsonplaceholder.typicode.com/users?id=1&foo=bar&id=2 response: status: 200 body: diff --git a/tests/execution/batching-group-by-default.md b/tests/execution/batching-group-by-default.md index 78ead4a198..ec369b70e2 100644 --- a/tests/execution/batching-group-by-default.md +++ b/tests/execution/batching-group-by-default.md @@ -47,7 +47,7 @@ type User { userId: 2 - request: method: GET - url: http://jsonplaceholder.typicode.com/users?id=1&foo=bar&id=2&foo=bar + url: http://jsonplaceholder.typicode.com/users?id=1&foo=bar&id=2 response: status: 200 body: diff --git a/tests/execution/batching-group-by.md b/tests/execution/batching-group-by.md index 985138ab9a..c2469cae71 100644 --- a/tests/execution/batching-group-by.md +++ b/tests/execution/batching-group-by.md @@ -47,7 +47,7 @@ type User { userId: 2 - request: method: GET - url: http://jsonplaceholder.typicode.com/users?id=1&foo=bar&id=2&foo=bar + url: http://jsonplaceholder.typicode.com/users?id=1&foo=bar&id=2 response: status: 200 body: