pub trait RelayNodeInterfacewhere
Self: Sized,{
// Required method
fn fetch_node<'async_trait>(
ctx: RelayContext,
relay_id: String,
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
where Self: 'async_trait;
}
Expand description
RelayNodeInterface is a trait implemented by the GraphQL interface enum to implement the fetch_node method. You should refer to the ‘RelayInterface’ macro which is the recommended way to implement this trait.
Required Methods§
Sourcefn fetch_node<'async_trait>(
ctx: RelayContext,
relay_id: String,
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
fn fetch_node<'async_trait>(
ctx: RelayContext,
relay_id: String,
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
fetch_node takes in a RelayContext and a generic relay ID and will return a Node interface with the requested object. This function is used to implement the ‘node’ query required by the Relay server specification for easily refetching an entity in the GraphQL schema.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.