docs: Fix `#[SimpleObject]` in federation examples
This commit is contained in:
parent
ffa25cecf5
commit
60eeafe323
|
@ -133,7 +133,7 @@ Apply the [`@shareable` directive](https://www.apollographql.com/docs/federation
|
||||||
```rust
|
```rust
|
||||||
# extern crate async_graphql;
|
# extern crate async_graphql;
|
||||||
# use async_graphql::*;
|
# use async_graphql::*;
|
||||||
#[SimpleObject]
|
#[derive(SimpleObject)]
|
||||||
#[graphql(complex)]
|
#[graphql(complex)]
|
||||||
struct Position {
|
struct Position {
|
||||||
#[graphql(shareable)]
|
#[graphql(shareable)]
|
||||||
|
@ -164,7 +164,7 @@ type Position {
|
||||||
```rust
|
```rust
|
||||||
# extern crate async_graphql;
|
# extern crate async_graphql;
|
||||||
# use async_graphql::*;
|
# use async_graphql::*;
|
||||||
#[SimpleObject]
|
#[derive(SimpleObject)]
|
||||||
#[graphql(shareable)]
|
#[graphql(shareable)]
|
||||||
struct Position {
|
struct Position {
|
||||||
x: u64,
|
x: u64,
|
||||||
|
@ -188,7 +188,7 @@ The [`@inaccessible` directive](https://www.apollographql.com/docs/federation/fe
|
||||||
```rust
|
```rust
|
||||||
# extern crate async_graphql;
|
# extern crate async_graphql;
|
||||||
# use async_graphql::*;
|
# use async_graphql::*;
|
||||||
#[SimpleObject]
|
#[derive(SimpleObject)]
|
||||||
#[graphql(shareable)]
|
#[graphql(shareable)]
|
||||||
struct Position {
|
struct Position {
|
||||||
x: u32,
|
x: u32,
|
||||||
|
@ -217,7 +217,7 @@ For example, if you add a new "Inventory" subgraph which should take over respon
|
||||||
```rust
|
```rust
|
||||||
# extern crate async_graphql;
|
# extern crate async_graphql;
|
||||||
# use async_graphql::*;
|
# use async_graphql::*;
|
||||||
#[SimpleObject]
|
#[derive(SimpleObject)]
|
||||||
struct Product {
|
struct Product {
|
||||||
id: ID,
|
id: ID,
|
||||||
#[graphql(override_from = "Products")]
|
#[graphql(override_from = "Products")]
|
||||||
|
@ -241,7 +241,7 @@ The [`@external` directive](https://www.apollographql.com/docs/federation/federa
|
||||||
```rust
|
```rust
|
||||||
# extern crate async_graphql;
|
# extern crate async_graphql;
|
||||||
# use async_graphql::*;
|
# use async_graphql::*;
|
||||||
#[SimpleObject]
|
#[derive(SimpleObject)]
|
||||||
struct Product {
|
struct Product {
|
||||||
id: ID,
|
id: ID,
|
||||||
#[graphql(external)]
|
#[graphql(external)]
|
||||||
|
@ -267,7 +267,7 @@ The [`@provides` directive](https://www.apollographql.com/docs/federation/federa
|
||||||
```rust
|
```rust
|
||||||
# extern crate async_graphql;
|
# extern crate async_graphql;
|
||||||
# use async_graphql::*;
|
# use async_graphql::*;
|
||||||
#[SimpleObject]
|
#[derive(SimpleObject)]
|
||||||
struct Product {
|
struct Product {
|
||||||
id: ID,
|
id: ID,
|
||||||
#[graphql(external)]
|
#[graphql(external)]
|
||||||
|
@ -341,7 +341,7 @@ In order to implement this in Rust, we can use the `#[graphql(requires)]` attrib
|
||||||
```rust
|
```rust
|
||||||
# extern crate async_graphql;
|
# extern crate async_graphql;
|
||||||
# use async_graphql::*;
|
# use async_graphql::*;
|
||||||
#[SimpleObject]
|
#[derive(SimpleObject)]
|
||||||
#[graphql(complex)]
|
#[graphql(complex)]
|
||||||
struct Product {
|
struct Product {
|
||||||
id: ID,
|
id: ID,
|
||||||
|
@ -366,7 +366,7 @@ Note that we use the GraphQL field name `weightInPounds`, not the Rust field nam
|
||||||
```rust
|
```rust
|
||||||
# extern crate async_graphql;
|
# extern crate async_graphql;
|
||||||
# use async_graphql::*;
|
# use async_graphql::*;
|
||||||
# #[SimpleObject]
|
# #[derive(SimpleObject)]
|
||||||
# #[graphql(complex)]
|
# #[graphql(complex)]
|
||||||
# struct Product {
|
# struct Product {
|
||||||
# id: ID,
|
# id: ID,
|
||||||
|
@ -435,7 +435,7 @@ You can write code like this:
|
||||||
```rust
|
```rust
|
||||||
# extern crate async_graphql;
|
# extern crate async_graphql;
|
||||||
# use async_graphql::*;
|
# use async_graphql::*;
|
||||||
#[SimpleObject]
|
#[derive(SimpleObject)]
|
||||||
#[graphql(tag = "team-accounts")]
|
#[graphql(tag = "team-accounts")]
|
||||||
struct User {
|
struct User {
|
||||||
id: ID,
|
id: ID,
|
||||||
|
|
Loading…
Reference in New Issue