mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
DOCS Disable versioning on GraphQL (#9769)
* DOCS Disable versioning on GraphQL Fixes #320 * Fix yaml snippet Co-authored-by: Aaron Carlino <unclecheese@leftandmain.com>
This commit is contained in:
parent
c6d6358e45
commit
5a4641d806
@ -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
|
||||
|
||||
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user