Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Jun 13, 2024
1 parent 808bc43 commit 4890980
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions generated/.tailcallrc.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ directive @server(
"""
batchRequests: Boolean
"""
When set to `true`, it will ensure no graphQL execution is made more than once if
similar query is being executed across the server's lifetime.
Enables deduplication of IO operations to enhance performance.This flag prevents
duplicate IO requests from being executed concurrently, reducing resource load. Caution:
May lead to issues with APIs that expect unique results for identical inputs, such
as nonce-based APIs.
"""
dedupe: Boolean
"""
Expand Down
2 changes: 1 addition & 1 deletion generated/.tailcallrc.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@
]
},
"dedupe": {
"description": "When set to `true`, it will ensure no graphQL execution is made more than once if similar query is being executed across the server's lifetime.",
"description": "Enables deduplication of IO operations to enhance performance.\n\nThis flag prevents duplicate IO requests from being executed concurrently, reducing resource load. Caution: May lead to issues with APIs that expect unique results for identical inputs, such as nonce-based APIs.",
"type": [
"boolean",
"null"
Expand Down
9 changes: 6 additions & 3 deletions src/core/config/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ pub struct Server {
pub batch_requests: Option<bool>,

#[serde(default, skip_serializing_if = "is_default")]
/// When set to `true`, it will ensure no graphQL execution is made more
/// than once if similar query is being executed across the
/// server's lifetime.
/// Enables deduplication of IO operations to enhance performance.
///
/// This flag prevents duplicate IO requests from being executed
/// concurrently, reducing resource load. Caution: May lead to issues
/// with APIs that expect unique results for identical inputs, such as
/// nonce-based APIs.
pub dedupe: Option<bool>,

#[serde(default, skip_serializing_if = "is_default")]
Expand Down
3 changes: 1 addition & 2 deletions src/core/ir/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ impl Eval for IO {
if let Some(key) = self.cache_key(&ctx) {
Box::pin(async move {
if ctx.request_ctx.server.dedupe {
ctx
.request_ctx
ctx.request_ctx
.cache
.dedupe(&key.clone(), || {
Box::pin(async move {
Expand Down

0 comments on commit 4890980

Please sign in to comment.