Skip to content

Commit

Permalink
fix: remove repeated non batch key (#2344)
Browse files Browse the repository at this point in the history
  • Loading branch information
ouertani committed Jul 4, 2024
1 parent 122afb5 commit 1f74665
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/core/http/data_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ impl Loader<DataLoaderRequest> 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
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/batching-default.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/batching-group-by-default.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/batching-group-by.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

1 comment on commit 1f74665

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running 30s test @ http://localhost:8000/graphql

4 threads and 100 connections

Thread Stats Avg Stdev Max +/- Stdev
Latency 7.48ms 4.12ms 185.94ms 81.02%
Req/Sec 3.41k 192.02 3.97k 92.75%

407078 requests in 30.01s, 2.04GB read

Requests/sec: 13565.18

Transfer/sec: 69.63MB

Please sign in to comment.