Skip to content

Commit 30f08d2

Browse files
committed
Docs
1 parent e0383dd commit 30f08d2

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

bin/router/src/pipeline/query_plan.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ pub async fn plan_operation_with_cache(
2323
let filtered_operation_for_plan = &normalized_operation.operation_for_plan;
2424

2525
if app_state.router_config.query_planner.no_plan_cache {
26+
if filtered_operation_for_plan.selection_set.is_empty()
27+
&& normalized_operation.operation_for_introspection.is_some()
28+
{
29+
debug!("No need for a plan, as the incoming query only involves introspection fields");
30+
31+
return Ok(Arc::new(QueryPlan {
32+
kind: "QueryPlan".to_string(),
33+
node: None,
34+
}));
35+
}
2636
let plan = app_state
2737
.planner
2838
.plan_from_normalized_operation(

docs/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
|----|----|-----------|--------|
77
|[**http**](#http)|`object`|Configuration for the HTTP server/listener.<br/>Default: `{"host":"0.0.0.0","port":4000}`<br/>||
88
|[**log**](#log)|`object`|The router logger configuration.<br/>Default: `{"filter":null,"format":"json","level":"info"}`<br/>||
9-
|[**query\_planner**](#query_planner)|`object`|Query planning configuration.<br/>Default: `{"allow_expose":false}`<br/>||
9+
|[**query\_planner**](#query_planner)|`object`|Query planning configuration.<br/>Default: `{"allow_expose":false,"no_plan_cache":false}`<br/>||
1010
|[**supergraph**](#supergraph)|`object`|Configuration for the Federation supergraph source. By default, the router will use a local file-based supergraph source (`./supergraph.graphql`).<br/>Default: `{"path":"supergraph.graphql","source":"file"}`<br/>||
1111
|[**traffic\_shaping**](#traffic_shaping)|`object`|Configuration for the traffic-shaper executor. Use these configurations to control how requests are being executed to subgraphs.<br/>Default: `{"dedupe_enabled":true,"dedupe_fingerprint_headers":["authorization"],"max_connections_per_host":100,"pool_idle_timeout_seconds":50}`<br/>||
1212

@@ -23,6 +23,7 @@ log:
2323
level: info
2424
query_planner:
2525
allow_expose: false
26+
no_plan_cache: false
2627
supergraph:
2728
path: supergraph.graphql
2829
source: file
@@ -92,11 +93,13 @@ Query planning configuration.
9293
|Name|Type|Description|Required|
9394
|----|----|-----------|--------|
9495
|**allow\_expose**|`boolean`|A flag to allow exposing the query plan in the response.<br/>When set to `true` and an incoming request has a `hive-expose-query-plan: true` header, the query plan will be exposed in the response, as part of `extensions`.<br/>Default: `false`<br/>||
96+
|**no\_plan\_cache**|`boolean`|Default: `false`<br/>||
9597

9698
**Example**
9799

98100
```yaml
99101
allow_expose: false
102+
no_plan_cache: false
100103
101104
```
102105

0 commit comments

Comments
 (0)