Skip to content

Commit

Permalink
Fix update/delete relation docs
Browse files Browse the repository at this point in the history
Fixes #6872
  • Loading branch information
rijkvanzanten committed Jul 19, 2021
1 parent 9ca5a34 commit f8eb5ee
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions docs/reference/api/system/relations.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,13 @@ Returns the [relation object](#the-relation-object) for the created relation.
### REST API

```
PATCH /relations/:id
PATCH /relations/:collection/:field
```

##### Example

```json
// PATCH /relations/15
// PATCH /relations/articles/author

{
"meta": {
Expand All @@ -443,15 +443,15 @@ POST /graphql/system

```graphql
type Mutation {
update_relations_item(id: ID!, data: update_directus_relations_input!): directus_relations
update_relations_item(collection: String!, field: String!, data: update_directus_relations_input!): directus_relations
}
```

##### Example

```graphql
mutation {
update_relations_item(id: 15, data: { meta: { one_field: "articles" } }) {
update_relations_item(collection: "articles", field: "author", data: { meta: { one_field: "articles" } }) {
collection
field
related_collection
Expand Down Expand Up @@ -481,13 +481,13 @@ Empty body.
### REST API

```
DELETE /relations/:id
DELETE /relations/:collection/:field
```

##### Example

```
DELETE /relations/15
DELETE /relations/articles/author
```

### GraphQL
Expand All @@ -498,16 +498,17 @@ POST /graphql/system

```graphql
type Mutation {
delete_relations_item(id: ID!): delete_one
delete_relations_item(collection: String!, field: String!): delete_one
}
```

##### Example

```graphql
mutation {
delete_relations_item(id: 15) {
id
delete_relations_item(collection: "articles", field: "author") {
collection
field
}
}
```
Expand Down

0 comments on commit f8eb5ee

Please sign in to comment.