Struct apollo_router::test_harness::MockedSubgraphs
source ยท pub struct MockedSubgraphs(/* private fields */);
Expand description
a list of subgraphs with pregenerated responses
Implementationsยง
sourceยงimpl MockedSubgraphs
impl MockedSubgraphs
sourcepub fn insert(&mut self, name: &'static str, subgraph: MockSubgraph)
pub fn insert(&mut self, name: &'static str, subgraph: MockSubgraph)
adds a mocked subgraph to the list
Trait Implementationsยง
sourceยงimpl Default for MockedSubgraphs
impl Default for MockedSubgraphs
sourceยงfn default() -> MockedSubgraphs
fn default() -> MockedSubgraphs
Returns the โdefault valueโ for a type. Read more
sourceยงimpl Plugin for MockedSubgraphs
impl Plugin for MockedSubgraphs
sourceยงfn new<'async_trait>(
__arg0: PluginInit<Self::Config>
) -> Pin<Box<dyn Future<Output = Result<Self, BoxError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn new<'async_trait>(
__arg0: PluginInit<Self::Config>
) -> Pin<Box<dyn Future<Output = Result<Self, BoxError>> + Send + 'async_trait>>where
Self: 'async_trait,
This is invoked once after the router starts and compiled-in
plugins are registered.
sourceยงfn subgraph_service(
&self,
subgraph_name: &str,
default: BoxService
) -> BoxService
fn subgraph_service( &self, subgraph_name: &str, default: BoxService ) -> BoxService
This service handles communication between the Apollo Router and your subgraphs.
Define
subgraph_service
to configure this communication (for example, to dynamically add headers to pass to a subgraph).
The _subgraph_name
parameter is useful if you need to apply a customization only specific subgraphs.sourceยงfn router_service(&self, service: BoxService) -> BoxService
fn router_service(&self, service: BoxService) -> BoxService
This function is EXPERIMENTAL and its signature is subject to change. Read more
sourceยงfn supergraph_service(&self, service: BoxService) -> BoxService
fn supergraph_service(&self, service: BoxService) -> BoxService
This service runs after the HTTP request payload has been deserialized into a GraphQL request,
and before the GraphQL response payload is serialized into a raw HTTP response.
Define supergraph_service if your customization needs to interact at the earliest or latest point possible, yet operates on GraphQL payloads.
sourceยงfn execution_service(&self, service: BoxService) -> BoxService
fn execution_service(&self, service: BoxService) -> BoxService
This service handles initiating the execution of a query plan after itโs been generated.
Define
execution_service
if your customization includes logic to govern execution (for example, if you want to block a particular query based on a policy decision).sourceยงfn web_endpoints(&self) -> MultiMap<ListenAddr, Endpoint>
fn web_endpoints(&self) -> MultiMap<ListenAddr, Endpoint>
Return one or several
Endpoint
s and ListenAddr
and the router will serve your custom web Endpoint(s). Read moreAuto Trait Implementationsยง
impl Freeze for MockedSubgraphs
impl !RefUnwindSafe for MockedSubgraphs
impl Send for MockedSubgraphs
impl Sync for MockedSubgraphs
impl Unpin for MockedSubgraphs
impl !UnwindSafe for MockedSubgraphs
Blanket Implementationsยง
sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceยงimpl<T> FutureExt for T
impl<T> FutureExt for T
sourceยงfn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourceยงfn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceยงimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourceยงfn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
Creates a shared type from an unshared type.
sourceยงimpl<P> PluginUnstable for Pwhere
P: Plugin,
impl<P> PluginUnstable for Pwhere
P: Plugin,
sourceยงfn new<'async_trait>(
init: PluginInit<<P as PluginUnstable>::Config>
) -> Pin<Box<dyn Future<Output = Result<P, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>where
P: 'async_trait,
fn new<'async_trait>(
init: PluginInit<<P as PluginUnstable>::Config>
) -> Pin<Box<dyn Future<Output = Result<P, Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>where
P: 'async_trait,
This is invoked once after the router starts and compiled-in
plugins are registered.
sourceยงfn router_service(
&self,
service: BoxService<Request, Response, Box<dyn Error + Sync + Send>>
) -> BoxService<Request, Response, Box<dyn Error + Sync + Send>>
fn router_service( &self, service: BoxService<Request, Response, Box<dyn Error + Sync + Send>> ) -> BoxService<Request, Response, Box<dyn Error + Sync + Send>>
This function is EXPERIMENTAL and its signature is subject to change. Read more
sourceยงfn supergraph_service(
&self,
service: BoxService<Request, Response, Box<dyn Error + Sync + Send>>
) -> BoxService<Request, Response, Box<dyn Error + Sync + Send>>
fn supergraph_service( &self, service: BoxService<Request, Response, Box<dyn Error + Sync + Send>> ) -> BoxService<Request, Response, Box<dyn Error + Sync + Send>>
This service runs after the HTTP request payload has been deserialized into a GraphQL request,
and before the GraphQL response payload is serialized into a raw HTTP response.
Define supergraph_service if your customization needs to interact at the earliest or latest point possible, yet operates on GraphQL payloads.
sourceยงfn execution_service(
&self,
service: BoxService<Request, Response, Box<dyn Error + Sync + Send>>
) -> BoxService<Request, Response, Box<dyn Error + Sync + Send>>
fn execution_service( &self, service: BoxService<Request, Response, Box<dyn Error + Sync + Send>> ) -> BoxService<Request, Response, Box<dyn Error + Sync + Send>>
This service handles initiating the execution of a query plan after itโs been generated.
Define
execution_service
if your customization includes logic to govern execution (for example, if you want to block a particular query based on a policy decision).sourceยงfn subgraph_service(
&self,
subgraph_name: &str,
service: BoxService<Request, Response, Box<dyn Error + Sync + Send>>
) -> BoxService<Request, Response, Box<dyn Error + Sync + Send>>
fn subgraph_service( &self, subgraph_name: &str, service: BoxService<Request, Response, Box<dyn Error + Sync + Send>> ) -> BoxService<Request, Response, Box<dyn Error + Sync + Send>>
This service handles communication between the Apollo Router and your subgraphs.
Define
subgraph_service
to configure this communication (for example, to dynamically add headers to pass to a subgraph).
The _subgraph_name
parameter is useful if you need to apply a customization only specific subgraphs.sourceยงfn web_endpoints(&self) -> MultiMap<ListenAddr, Endpoint>
fn web_endpoints(&self) -> MultiMap<ListenAddr, Endpoint>
Return one or several
Endpoint
s and ListenAddr
and the router will serve your custom web Endpoint(s). Read moresourceยงfn unstable_method(&self)
fn unstable_method(&self)
test