pub trait OutputType: Send + Sync {
// Required methods
fn type_name() -> Cow<'static, str>;
fn create_type_info(registry: &mut Registry) -> String;
fn resolve(
&self,
ctx: &ContextSelectionSet<'_>,
field: &Positioned<Field>,
) -> impl Future<Output = ServerResult<Value>> + Send;
// Provided methods
fn qualified_type_name() -> String { ... }
fn introspection_type_name(&self) -> Cow<'static, str> { ... }
}
Expand description
Represents a GraphQL output type.
Required Methods§
sourcefn 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.
sourcefn resolve(
&self,
ctx: &ContextSelectionSet<'_>,
field: &Positioned<Field>,
) -> impl Future<Output = ServerResult<Value>> + Send
fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> impl Future<Output = ServerResult<Value>> + Send
Resolve an output value to async_graphql::Value
.
Provided Methods§
sourcefn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
sourcefn introspection_type_name(&self) -> Cow<'static, str>
fn introspection_type_name(&self) -> Cow<'static, str>
Introspection type name
Is the return value of field __typename
, the interface and union
should return the current type, and the others return Type::type_name
.
Object Safety§
This trait is not object safe.