Skip to content

Commit d069f91

Browse files
committed
Fix
1 parent 8c0549a commit d069f91

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

docs/README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
|[**override\_subgraph\_urls**](#override_subgraph_urls)|`object`|Configuration for overriding subgraph URLs.<br/>Default: `{}`<br/>||
1616
|[**query\_planner**](#query_planner)|`object`|Query planning configuration.<br/>Default: `{"allow_expose":false,"timeout":"10s"}`<br/>||
1717
|[**supergraph**](#supergraph)|`object`|Configuration for the Federation supergraph source. By default, the router will use a local file-based supergraph source (`./supergraph.graphql`).<br/>||
18-
|[**traffic\_shaping**](#traffic_shaping)|`object`|Configuration for the traffic-shaping of the executor. Use these configurations to control how requests are being executed to subgraphs.<br/>Default: `{"all":{"dedupe_enabled":true,"pool_idle_timeout":"50s","request_timeout":{"Duration":"15s"}},"max_connections_per_host":100}`<br/>||
18+
|[**traffic\_shaping**](#traffic_shaping)|`object`|Configuration for the traffic-shaping of the executor. Use these configurations to control how requests are being executed to subgraphs.<br/>Default: `{"all":{"dedupe_enabled":true,"pool_idle_timeout":"50s","request_timeout":"30s"},"max_connections_per_host":100}`<br/>||
1919

2020
**Additional Properties:** not allowed
2121
**Example**
@@ -110,8 +110,7 @@ traffic_shaping:
110110
all:
111111
dedupe_enabled: true
112112
pool_idle_timeout: 50s
113-
request_timeout:
114-
Duration: 15s
113+
request_timeout: 30s
115114
max_connections_per_host: 100
116115

117116
```
@@ -1818,7 +1817,7 @@ Configuration for the traffic-shaping of the executor. Use these configurations
18181817

18191818
|Name|Type|Description|Required|
18201819
|----|----|-----------|--------|
1821-
|[**all**](#traffic_shapingall)|`object`|The default configuration that will be applied to all subgraphs, unless overridden by a specific subgraph configuration.<br/>Default: `{"dedupe_enabled":true,"pool_idle_timeout":"50s","request_timeout":{"Duration":"15s"}}`<br/>||
1820+
|[**all**](#traffic_shapingall)|`object`|The default configuration that will be applied to all subgraphs, unless overridden by a specific subgraph configuration.<br/>Default: `{"dedupe_enabled":true,"pool_idle_timeout":"50s","request_timeout":"30s"}`<br/>||
18221821
|**max\_connections\_per\_host**|`integer`|Limits the concurrent amount of requests/connections per host/subgraph.<br/>Default: `100`<br/>Format: `"uint"`<br/>Minimum: `0`<br/>||
18231822
|[**subgraphs**](#traffic_shapingsubgraphs)|`object`|Optional per-subgraph configurations that will override the default configuration for specific subgraphs.<br/>||
18241823

@@ -1829,8 +1828,7 @@ Configuration for the traffic-shaping of the executor. Use these configurations
18291828
all:
18301829
dedupe_enabled: true
18311830
pool_idle_timeout: 50s
1832-
request_timeout:
1833-
Duration: 15s
1831+
request_timeout: 30s
18341832
max_connections_per_host: 100
18351833
18361834
```
@@ -1847,16 +1845,15 @@ The default configuration that will be applied to all subgraphs, unless overridd
18471845
|----|----|-----------|--------|
18481846
|**dedupe\_enabled**|`boolean`|Enables/disables request deduplication to subgraphs.<br/><br/>When requests exactly matches the hashing mechanism (e.g., subgraph name, URL, headers, query, variables), and are executed at the same time, they will<br/>be deduplicated by sharing the response of other in-flight requests.<br/>Default: `true`<br/>||
18491847
|**pool\_idle\_timeout**|`string`|Timeout for idle sockets being kept-alive.<br/>Default: `"50s"`<br/>||
1850-
|**request\_timeout**||Optional timeout configuration for requests to subgraphs.<br/><br/>Example with a fixed duration:<br/>```yaml<br/> timeout:<br/> duration: 5s<br/>```<br/><br/>Or with a VRL expression that can return a duration based on the operation kind:<br/>```yaml<br/> timeout:<br/> expression: \|<br/> if (.request.operation.type == "mutation") {<br/> "10s"<br/> } else {<br/> "15s"<br/> }<br/>```<br/>Default: `{"Duration":"15s"}`<br/>||
1848+
|**request\_timeout**||Optional timeout configuration for requests to subgraphs.<br/><br/>Example with a fixed duration:<br/>```yaml<br/> timeout:<br/> duration: 5s<br/>```<br/><br/>Or with a VRL expression that can return a duration based on the operation kind:<br/>```yaml<br/> timeout:<br/> expression: \|<br/> if (.request.operation.type == "mutation") {<br/> "10s"<br/> } else {<br/> "15s"<br/> }<br/>```<br/>Default: `"30s"`<br/>||
18511849

18521850
**Additional Properties:** not allowed
18531851
**Example**
18541852

18551853
```yaml
18561854
dedupe_enabled: true
18571855
pool_idle_timeout: 50s
1858-
request_timeout:
1859-
Duration: 15s
1856+
request_timeout: 30s
18601857
18611858
```
18621859

lib/router-config/src/traffic_shaping.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ fn default_request_timeout() -> DurationOrExpression {
123123
}
124124

125125
#[derive(Debug, Deserialize, Serialize, JsonSchema, Clone)]
126+
#[serde(untagged)]
126127
pub enum DurationOrExpression {
127128
/// A fixed duration, e.g., "5s" or "100ms".
128129
#[serde(

0 commit comments

Comments
 (0)