pub struct SchemaExtensions {
pub relations: Vec<Relation>,
pub mutations: Vec<(String, MutationKind)>,
pub subscriptions: Vec<String>,
}Expand description
Schema 扩展配置
将关联关系、分页类型、变更、订阅等扩展信息附加到既有 schema
Fields§
§relations: Vec<Relation>关联关系列表
mutations: Vec<(String, MutationKind)>变更定义列表(类型名 + 操作类型)
subscriptions: Vec<String>订阅主题列表
Implementations§
Source§impl SchemaExtensions
impl SchemaExtensions
pub fn new() -> Self
Sourcepub fn with_relation(self, relation: Relation) -> Self
pub fn with_relation(self, relation: Relation) -> Self
添加关联关系
Sourcepub fn with_mutation(
self,
type_name: impl Into<String>,
kind: MutationKind,
) -> Self
pub fn with_mutation( self, type_name: impl Into<String>, kind: MutationKind, ) -> Self
添加变更定义
Sourcepub fn with_subscription(self, topic: impl Into<String>) -> Self
pub fn with_subscription(self, topic: impl Into<String>) -> Self
添加订阅主题
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SchemaExtensions
impl RefUnwindSafe for SchemaExtensions
impl Send for SchemaExtensions
impl Sync for SchemaExtensions
impl Unpin for SchemaExtensions
impl UnsafeUnpin for SchemaExtensions
impl UnwindSafe for SchemaExtensions
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