Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ By [@USERNAME](https://github.com/USERNAME) in https://github.com/apollographql/

## ❗ BREAKING ❗

### Put `query_plan_options` in private and wrap `QueryPlanContent` in an opaque type ([PR #1486](https://github.com/apollographql/router/pull/1486))

`QueryPlanOptions::query_plan_options` is no longer available in public.

By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/1486

### Removed `delay_interval` in telemetry configuration. [PR #FIXME]

It was doing nothing.
Expand Down Expand Up @@ -56,6 +62,7 @@ It is now possible to create a subscriber and pass it explicitely to the telemet
when creating it. It will then be modified to integrate the telemetry plugin's layer.

By [@geal](https://github.com/geal) in https://github.com/apollographql/router/pull/1463
>>>>>>> be6590826afb60bf3c683315c68f9ed47594a2a3

## 🚀 Features

Expand Down
10 changes: 2 additions & 8 deletions apollo-router/src/query_planner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ mod selection;

/// Query planning options.
#[derive(Clone, Eq, Hash, PartialEq, Debug, Default)]
pub struct QueryPlanOptions {
pub(crate) struct QueryPlanOptions {
/// Enable the variable deduplication optimization on the QueryPlan
pub enable_variable_deduplication: bool,
pub(crate) enable_variable_deduplication: bool,
}

/// A plan for a given GraphQL query
Expand Down Expand Up @@ -250,12 +250,6 @@ impl PlanNode {
}

impl QueryPlan {
/// Pass some options to the QueryPlan
pub fn with_options(mut self, options: QueryPlanOptions) -> Self {
self.options = options;
self
}

/// Execute the plan and return a [`Response`].
pub async fn execute<'a, SF>(
&self,
Expand Down
18 changes: 11 additions & 7 deletions apollo-router/src/services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@ impl RouterResponse {
}

assert_impl_all!(QueryPlannerRequest: Send);
/// [`Context`] and [`QueryPlanOptions`] for the request.
/// [`Context`] for the request.
#[derive(Clone, Debug)]
pub struct QueryPlannerRequest {
pub query: String,
pub operation_name: Option<String>,
/// Query plan options
pub query_plan_options: QueryPlanOptions,
pub(crate) query_plan_options: QueryPlanOptions,

pub context: Context,
}
Expand All @@ -302,22 +302,21 @@ impl QueryPlannerRequest {
pub fn new(
query: String,
operation_name: Option<String>,
query_plan_options: QueryPlanOptions,
context: Context,
) -> QueryPlannerRequest {
Self {
query,
operation_name,
query_plan_options,
query_plan_options: QueryPlanOptions::default(),
context,
}
}
}

assert_impl_all!(QueryPlannerResponse: Send);
/// [`Context`] and [`QueryPlan`] for the response..
/// [`Context`] and [`QueryPlan`] for the response.
pub struct QueryPlannerResponse {
pub content: QueryPlannerContent,
pub(crate) content: QueryPlannerContent,
pub context: Context,
}

Expand All @@ -340,7 +339,7 @@ impl QueryPlannerResponse {
///
/// Required parameters are required in non-testing code to create a QueryPlannerResponse.
#[builder]
pub fn new(content: QueryPlannerContent, context: Context) -> QueryPlannerResponse {
pub(crate) fn new(content: QueryPlannerContent, context: Context) -> QueryPlannerResponse {
Self { content, context }
}

Expand All @@ -364,6 +363,11 @@ impl QueryPlannerResponse {
context,
))
}

/// Get a reference of the query plan
pub fn query_plan(&self) -> &QueryPlannerContent {
&self.content
}
}

assert_impl_all!(SubgraphRequest: Send);
Expand Down
2 changes: 0 additions & 2 deletions apollo-router/src/services/router_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ use crate::plugin::DynPlugin;
use crate::plugin::Plugin;
use crate::query_planner::BridgeQueryPlanner;
use crate::query_planner::CachingQueryPlanner;
use crate::query_planner::QueryPlanOptions;
use crate::router_factory::RouterServiceFactory;
use crate::services::layers::apq::APQLayer;
use crate::services::layers::ensure_query_presence::EnsureQueryPresence;
Expand Down Expand Up @@ -125,7 +124,6 @@ where
.expect("the query presence was already checked by a plugin"),
)
.and_operation_name(body.operation_name.clone())
.query_plan_options(QueryPlanOptions::default())
.context(context)
.build(),
)
Expand Down