Skip to content

Commit

Permalink
chore(Docs): Update graph-links.md to remove a duplicate word. (#6378)
Browse files Browse the repository at this point in the history
remove duplicate word "doesn't" from description of two-way edges.

(cherry picked from commit abec436)
  • Loading branch information
haikusw authored and danielmai committed Sep 3, 2020
1 parent 6439b52 commit ea08797
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wiki/content/graphql/schema/graph-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Post {
}
```

Then, the schema says that an author has a list of posts and a post has an author. But, that GraphQL schema doesn't doesn't say that every post in the list of posts for an author has the same author as their `author`. For example, it's perfectly valid for author `a1` to have a `posts` edge to post `p1`, that has an `author` edge to author `a2`. Here, we'd expect an author to be the author of all their posts, but that's not what GraphQL enforces. In GraphQL, it's left up to the implementation to make two-way connections in cases that make sense. That's just part of how GraphQL works.
Then, the schema says that an author has a list of posts and a post has an author. But, that GraphQL schema doesn't say that every post in the list of posts for an author has the same author as their `author`. For example, it's perfectly valid for author `a1` to have a `posts` edge to post `p1`, that has an `author` edge to author `a2`. Here, we'd expect an author to be the author of all their posts, but that's not what GraphQL enforces. In GraphQL, it's left up to the implementation to make two-way connections in cases that make sense. That's just part of how GraphQL works.

In Dgraph, the directive `@hasInverse` is used to create a two-way edge.

Expand Down Expand Up @@ -123,4 +123,4 @@ type Post {
}
```

Now, Dgraph will manage the connection between posts and authors and you can get on with concentrating on what your app needs to to - suggesting them interesting content.
Now, Dgraph will manage the connection between posts and authors and you can get on with concentrating on what your app needs to to - suggesting them interesting content.

0 comments on commit ea08797

Please sign in to comment.