async_graphql::types::connection

Struct Connection

Source
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,

Source

pub fn new(has_previous_page: bool, has_next_page: bool) -> Self

Create a new connection.

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,

Source

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,

Source§

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 more
Source§

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<()>
where Self: Send + Sync,

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,

Source§

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 more
Source§

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<()>
where Self: Send + Sync,

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,

Source§

fn type_name() -> Cow<'static, str>

Type the name.
Source§

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>

Resolve an output value to async_graphql::Value.
Source§

fn qualified_type_name() -> String

Qualified typename.
Source§

fn introspection_type_name(&self) -> Cow<'static, str>

Introspection type name Read more
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,

Source§

fn type_name() -> Cow<'static, str>

Type the name.
Source§

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>

Resolve an output value to async_graphql::Value.
Source§

fn qualified_type_name() -> String

Qualified typename.
Source§

fn introspection_type_name(&self) -> Cow<'static, str>

Introspection type name Read more
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,

Source§

fn type_name() -> Cow<'static, str>

Returns a GraphQL type name.
Source§

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,

Source§

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>
where ConnectionFields: Unpin, Name: Unpin, EdgeName: Unpin, NodesField: Unpin, Cursor: Unpin, Node: Unpin, EdgeFields: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.