pub struct Connection<Cursor, Node, ConnectionFields = EmptyFields, EdgeFields = EmptyFields, Name = DefaultConnectionName, EdgeName = DefaultEdgeName, NodesField = EnableNodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
NodesField: NodesFieldSwitcherSealed,{
pub edges: Vec<Edge<Cursor, Node, EdgeFields, EdgeName>>,
pub additional_fields: ConnectionFields,
pub has_previous_page: bool,
pub has_next_page: bool,
/* private fields */
}
Expand description
Connection type
Connection is the result of a query for connection::query
.
Fields§
§edges: Vec<Edge<Cursor, Node, EdgeFields, EdgeName>>
All edges of the current page.
additional_fields: ConnectionFields
Additional fields for connection object.
has_previous_page: bool
If true
means has previous page.
has_next_page: bool
If true
means has next page.
Implementations§
Source§impl<Cursor, Node, NodesField, EdgeFields, Name, EdgeName> Connection<Cursor, Node, EmptyFields, EdgeFields, Name, EdgeName, NodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
NodesField: NodesFieldSwitcherSealed,
impl<Cursor, Node, NodesField, EdgeFields, Name, EdgeName> Connection<Cursor, Node, EmptyFields, EdgeFields, Name, EdgeName, NodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
NodesField: NodesFieldSwitcherSealed,
Source§impl<Cursor, Node, NodesField, ConnectionFields, EdgeFields, Name, EdgeName> Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
NodesField: NodesFieldSwitcherSealed,
impl<Cursor, Node, NodesField, ConnectionFields, EdgeFields, Name, EdgeName> Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
NodesField: NodesFieldSwitcherSealed,
Sourcepub fn with_additional_fields(
has_previous_page: bool,
has_next_page: bool,
additional_fields: ConnectionFields,
) -> Self
pub fn with_additional_fields( has_previous_page: bool, has_next_page: bool, additional_fields: ConnectionFields, ) -> Self
Create a new connection, it can have some additional fields.
Trait Implementations§
Source§impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> ContainerType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, EnableNodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> ContainerType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, EnableNodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
Source§async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
Resolves a field value and outputs it as a json value
async_graphql::Value
. Read moreSource§async fn find_entity(
&self,
ctx: &Context<'_>,
params: &Value,
) -> ServerResult<Option<Value>>
async fn find_entity( &self, ctx: &Context<'_>, params: &Value, ) -> ServerResult<Option<Value>>
Find the GraphQL entity with the given name from the parameter. Read more
Source§fn collect_all_fields<'a>(
&'a self,
ctx: &ContextSelectionSet<'a>,
fields: &mut Fields<'a>,
) -> ServerResult<()>
fn collect_all_fields<'a>( &'a self, ctx: &ContextSelectionSet<'a>, fields: &mut Fields<'a>, ) -> ServerResult<()>
Collect all the fields of the container that are queried in the
selection set. Read more
Source§impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> ContainerType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, DisableNodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> ContainerType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, DisableNodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
Source§async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
Resolves a field value and outputs it as a json value
async_graphql::Value
. Read moreSource§async fn find_entity(
&self,
ctx: &Context<'_>,
params: &Value,
) -> ServerResult<Option<Value>>
async fn find_entity( &self, ctx: &Context<'_>, params: &Value, ) -> ServerResult<Option<Value>>
Find the GraphQL entity with the given name from the parameter. Read more
Source§fn collect_all_fields<'a>(
&'a self,
ctx: &ContextSelectionSet<'a>,
fields: &mut Fields<'a>,
) -> ServerResult<()>
fn collect_all_fields<'a>( &'a self, ctx: &ContextSelectionSet<'a>, fields: &mut Fields<'a>, ) -> ServerResult<()>
Collect all the fields of the container that are queried in the
selection set. Read more
Source§impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> OutputType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, EnableNodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> OutputType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, EnableNodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
Source§async fn resolve(
&self,
ctx: &ContextSelectionSet<'_>,
_field: &Positioned<Field>,
) -> ServerResult<Value>
async fn resolve( &self, ctx: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>
Resolve an output value to
async_graphql::Value
.Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
Source§impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> OutputType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, DisableNodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> OutputType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, DisableNodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
Source§async fn resolve(
&self,
ctx: &ContextSelectionSet<'_>,
_field: &Positioned<Field>,
) -> ServerResult<Value>
async fn resolve( &self, ctx: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>
Resolve an output value to
async_graphql::Value
.Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
Source§impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> TypeName for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
NodesField: NodesFieldSwitcherSealed,
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> TypeName for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
NodesField: NodesFieldSwitcherSealed,
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> ObjectType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, EnableNodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> ObjectType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, DisableNodesField>where
Cursor: CursorType + Send + Sync,
Node: OutputType,
ConnectionFields: ObjectType,
EdgeFields: ObjectType,
Name: ConnectionNameType,
EdgeName: EdgeNameType,
Auto Trait Implementations§
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> Freeze for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>where
ConnectionFields: Freeze,
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> RefUnwindSafe for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>where
ConnectionFields: RefUnwindSafe,
Name: RefUnwindSafe,
EdgeName: RefUnwindSafe,
NodesField: RefUnwindSafe,
Cursor: RefUnwindSafe,
Node: RefUnwindSafe,
EdgeFields: RefUnwindSafe,
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> Send for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> Sync for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> Unpin for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>
impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField> UnwindSafe for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, NodesField>where
ConnectionFields: UnwindSafe,
Name: UnwindSafe,
EdgeName: UnwindSafe,
NodesField: UnwindSafe,
Cursor: UnwindSafe,
Node: UnwindSafe,
EdgeFields: UnwindSafe,
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