Skip to content

Commit

Permalink
DOCS Disable versioning on GraphQL (#9769)
Browse files Browse the repository at this point in the history
* DOCS Disable versioning on GraphQL

Fixes #320

* Fix yaml snippet

Co-authored-by: Aaron Carlino <[email protected]>
  • Loading branch information
chillu and Aaron Carlino authored Feb 19, 2021
1 parent c6d6358 commit 5a4641d
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Docs for the current stable version (3.x) can be found

For the most part, if your DataObject has the `Versioned` extension applied, there is nothing you need to do
explicitly, but be aware that it will affect the operations and fields of your type.
You can also [disable](#disable) versioning for your schema if you don't need it.

### Versioned plugins

Expand Down Expand Up @@ -160,6 +161,30 @@ mutation copySiteTreeToStage(id: 123, fromStage: DRAFT, toStage: LIVE) {
}
```

### Disabling versioning on your schema {#disable}

Versioning is great for Content APIs (e.g. previews), but often not necessary for public APIs focusing on published data.
You can disable versioning for your schema in the `modelConfig` section:

**app/_graphql/config.yml**

```yaml
modelConfig:
DataObject:
plugins:
versioning: false
operations:
read:
plugins:
readVersion: false
readOne:
plugins:
readVersion: false
delete:
plugins:
unpublishOnDelete: false
```
### Further reading
[CHILDREN]

0 comments on commit 5a4641d

Please sign in to comment.