pub struct DatabaseEntityResolver<A: DatabaseAdapter> { /* private fields */ }Expand description
Resolves federation entities from local databases.
Implementations§
Source§impl<A: DatabaseAdapter> DatabaseEntityResolver<A>
impl<A: DatabaseAdapter> DatabaseEntityResolver<A>
Sourcepub fn new(adapter: Arc<A>, metadata: FederationMetadata) -> Self
pub fn new(adapter: Arc<A>, metadata: FederationMetadata) -> Self
Create a new database entity resolver.
Sourcepub async fn resolve_entities_from_db(
&self,
typename: &str,
representations: &[EntityRepresentation],
selection: &FieldSelection,
) -> Result<Vec<Option<Value>>>
pub async fn resolve_entities_from_db( &self, typename: &str, representations: &[EntityRepresentation], selection: &FieldSelection, ) -> Result<Vec<Option<Value>>>
Resolve entities from database.
§Arguments
typename- The entity type name (e.g., “User”)representations- Entity representations with key field valuesselection- Field selection from GraphQL query
§Returns
Vector of resolved entities (or None for missing entities)
§Errors
Returns error if database query fails
Sourcepub async fn resolve_entities_from_db_with_tracing(
&self,
typename: &str,
representations: &[EntityRepresentation],
selection: &FieldSelection,
_trace_context: Option<FederationTraceContext>,
) -> Result<Vec<Option<Value>>>
pub async fn resolve_entities_from_db_with_tracing( &self, typename: &str, representations: &[EntityRepresentation], selection: &FieldSelection, _trace_context: Option<FederationTraceContext>, ) -> Result<Vec<Option<Value>>>
Resolve entities from database with optional distributed tracing.
§Arguments
typename- The entity type name (e.g., “User”)representations- Entity representations with key field valuesselection- Field selection from GraphQL querytrace_context- Optional W3C trace context for span creation
§Returns
Vector of resolved entities (or None for missing entities)
§Errors
Returns error if database query fails
Auto Trait Implementations§
impl<A> Freeze for DatabaseEntityResolver<A>
impl<A> RefUnwindSafe for DatabaseEntityResolver<A>where
A: RefUnwindSafe,
impl<A> Send for DatabaseEntityResolver<A>
impl<A> Sync for DatabaseEntityResolver<A>
impl<A> Unpin for DatabaseEntityResolver<A>
impl<A> UnsafeUnpin for DatabaseEntityResolver<A>
impl<A> UnwindSafe for DatabaseEntityResolver<A>where
A: RefUnwindSafe,
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