Skip to content

Commit

Permalink
fix: making dedupe nullable in .tailcallrc.graphql (#1864)
Browse files Browse the repository at this point in the history
  • Loading branch information
shashitnak authored May 5, 2024
1 parent ebc2b79 commit 92f4fed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion generated/.tailcallrc.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ directive @upstream(
When set to `true`, it will ensure no HTTP, GRPC, or any other IO call is made more
than once within the context of a single GraphQL request.
"""
dedupe: Boolean!
dedupe: Boolean
"""
The `http2Only` setting allows you to specify whether the client should always issue
HTTP2 requests, without checking if the server supports it or not. By default it
Expand Down
5 changes: 4 additions & 1 deletion generated/.tailcallrc.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,10 @@
},
"dedupe": {
"description": "When set to `true`, it will ensure no HTTP, GRPC, or any other IO call is made more than once within the context of a single GraphQL request.",
"type": "boolean"
"type": [
"boolean",
"null"
]
},
"http2Only": {
"description": "The `http2Only` setting allows you to specify whether the client should always issue HTTP2 requests, without checking if the server supports it or not. By default it is set to `false` for all HTTP requests made by the server, but is automatically set to true for GRPC.",
Expand Down
4 changes: 2 additions & 2 deletions src/config/upstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub struct Upstream {
#[serde(default, skip_serializing_if = "is_default")]
/// When set to `true`, it will ensure no HTTP, GRPC, or any other IO call
/// is made more than once within the context of a single GraphQL request.
pub dedupe: bool,
pub dedupe: Option<bool>,
}

impl Upstream {
Expand Down Expand Up @@ -193,7 +193,7 @@ impl Upstream {
}

pub fn get_dedupe(&self) -> bool {
self.dedupe
self.dedupe.unwrap_or(false)
}
}

Expand Down

1 comment on commit 92f4fed

@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.51ms 9.02ms 781.71ms 99.53%
Req/Sec 3.46k 120.14 3.85k 85.00%

413676 requests in 30.01s, 2.07GB read

Requests/sec: 13786.86

Transfer/sec: 70.76MB

Please sign in to comment.