3b7ed74d11
- examples to fix still - error_extensions.md ResultExt example does not compile! - trait ErrorExtensions is not implemented for ParseIntError - dataloader - requires sqlx to work. So we either "stub" it OR we rewrite them simpler to use a simple "faux" db library
24 lines
439 B
Markdown
24 lines
439 B
Markdown
# SDL Export
|
|
|
|
You can export your schema in Schema Definition Language (SDL) by using the `Schema::sdl()` method.
|
|
|
|
|
|
```rust
|
|
# extern crate async_graphql;
|
|
use async_graphql::*;
|
|
|
|
struct Query;
|
|
|
|
#[Object]
|
|
impl Query {
|
|
async fn add(&self, u: i32, v: i32) -> i32 {
|
|
u + v
|
|
}
|
|
}
|
|
|
|
let schema = Schema::build(Query, EmptyMutation, EmptySubscription).finish();
|
|
|
|
// Print the schema in SDL format
|
|
println!("{}", &schema.sdl());
|
|
```
|