pub trait EntityFetcher: Send + Sync {
// Required method
fn fetch_as_json<'life0, 'life1, 'async_trait>(
&'life0 self,
entity_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn get_sample_entity<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn list_as_json<'life0, 'async_trait>(
&'life0 self,
_limit: Option<i32>,
_offset: Option<i32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Value>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Trait for fetching entities dynamically
This allows the link system to enrich links with full entity data without knowing the concrete entity types at compile time.
Required Methods§
Provided Methods§
Sourcefn get_sample_entity<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_sample_entity<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a sample entity for schema introspection
This method returns an entity with all fields populated (can be dummy data) to allow the GraphQL schema generator to discover the entity structure.
Default implementation returns an empty object.