async-graphql 1.9.21

The GraphQL server library implemented by rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 简单对象(SimpleObject)

简单对象是把Rust结构的所有字段都直接映射到GraphQL对象,不支持定义单独的Resolve函数。

下面的例子定义了一个名称为MyObject的对象,包含字段`a`和`b`,`c`由于标记为`#[field(skip)]`,所以不会映射到GraphQL。

```rust
use async_graphql::*;

#[SimpleObject]
struct MyObject {
    a: i32,
    b: i32,

    #[field(skip)]
    c: i32,
}
```