pub trait RelayNode: RelayNodeStruct {
    type TNode: RelayNodeInterface;

    // Required method
    fn get<'async_trait>(
        ctx: RelayContext,
        id: RelayNodeID<Self>
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self::TNode>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

RelayNode is a trait implemented on the GraphQL Object to define how it should be fetched. This is used by the ‘node’ query so that the object can be refetched.

Required Associated Types§

source

type TNode: RelayNodeInterface

TNode is the type of the Node interface. This should point the enum with the ‘RelayInterface’ macro.

Required Methods§

source

fn get<'async_trait>( ctx: RelayContext, id: RelayNodeID<Self> ) -> Pin<Box<dyn Future<Output = Result<Option<Self::TNode>, Error>> + Send + 'async_trait>>where Self: 'async_trait,

get is a method defines by the user to refetch an object of a particular type. The context can be used to share a database connection or other required context to facilitate the refetch.

Implementors§