[][src]Attribute Macro async_graphql::MergedObject

#[MergedObject]

Define a merged object with multiple object types.

You can also derive this.

See also the Book.

Macro parameters

AttributedescriptionTypeOptional
nameObject namestringY
descObject descriptionstringY
cache_controlObject cache controlCacheControlY
extendsAdd fields to an entity that's defined in another serviceboolY

Examples

use async_graphql::*;

#[SimpleObject]
 struct Object1 {
    a: i32,
 }

#[SimpleObject]
struct Object2 {
    b: i32,
}

#[SimpleObject]
struct Object3 {
    c: i32,
}

#[MergedObject]
struct MyObj(Object1, Object2, Object3);

let obj = MyObj(Object1 { a: 10 }, Object2 { b: 20 }, Object3 { c: 30 });