From 747a3526a4b6327b81d8acf8b564e6fc06bdc114 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Thu, 10 Aug 2023 09:40:39 +0200 Subject: [PATCH] self is immutable in the Plugin trait's methods (#3555) Fix #3539 --- .changesets/docs_geal_plugin_doc_fix.md | 4 ++++ docs/source/customizations/native.mdx | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .changesets/docs_geal_plugin_doc_fix.md diff --git a/.changesets/docs_geal_plugin_doc_fix.md b/.changesets/docs_geal_plugin_doc_fix.md new file mode 100644 index 0000000000..46552bb5b6 --- /dev/null +++ b/.changesets/docs_geal_plugin_doc_fix.md @@ -0,0 +1,4 @@ +### self is immutable in the Plugin trait's methods ([Issue #3539](https://github.com/apollographql/router/issues/3539)) + + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/3555 \ No newline at end of file diff --git a/docs/source/customizations/native.mdx b/docs/source/customizations/native.mdx index 8b2ffacf0e..3ad95c7cb9 100644 --- a/docs/source/customizations/native.mdx +++ b/docs/source/customizations/native.mdx @@ -96,21 +96,21 @@ impl Plugin for HelloWorld { // Only define the hooks you need to modify. Each default hook // implementation returns its associated service with no changes. fn router_service( - &mut self, + &self, service: router::BoxService, ) -> router::BoxService { service } fn supergraph_service( - &mut self, + &self, service: router::BoxService, ) -> router::BoxService { service } fn execution_service( - &mut self, + &self, service: execution::BoxService, ) -> execution::BoxService { service @@ -120,7 +120,7 @@ impl Plugin for HelloWorld { // being invoked. That's because this service might invoke *multiple* // subgraphs for a single request, and this is called once for each. fn subgraph_service( - &mut self, + &self, name: &str, service: subgraph::BoxService, ) -> subgraph::BoxService { @@ -141,7 +141,7 @@ use tower::ServiceBuilderExt; use apollo_router::ServiceBuilderExt as ApolloServiceBuilderExt; fn supergraph_service( - &mut self, + &self, service: router::BoxService, ) -> router::BoxService { // Always use service builder to compose your plugins.