[−][src]Derive Macro async_graphql::GQLMergedObject
#[derive(GQLMergedObject)] { // Attributes available to this derive: #[item] #[graphql] }
Define a merged object with multiple object types.
Macro parameters
Attribute | description | Type | Optional |
---|---|---|---|
name | Object name | string | Y |
desc | Object description | string | Y |
cache_control | Object cache control | CacheControl | Y |
extends | Add fields to an entity that's defined in another service | bool | Y |
Examples
use async_graphql::*; #[derive(GQLSimpleObject)] struct Object1 { a: i32, } #[derive(GQLSimpleObject)] struct Object2 { b: i32, } #[derive(GQLSimpleObject)] struct Object3 { c: i32, } #[derive(GQLMergedObject)] struct MyObj(Object1, Object2, Object3); let obj = MyObj(Object1 { a: 10 }, Object2 { b: 20 }, Object3 { c: 30 });