publicationState is removed and replaced by status
In Strapi 5, the Draft & Publish feature has been reworked, and the Content API, including REST API, GraphQL API, and Document Service API accept a new status parameter.
This page is part of the breaking changes database and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.
| π Is this breaking change affecting plugins? | Yes |
|---|
| π€ Is this breaking change automatically handled by a codemod? | Yes |
|---|
Breaking change descriptionβ
In Strapi v4
publicationState is used and accepts the following values:
livereturns only published entries,previewreturns both draft entries & published entries.
In Strapi 5
status is used and accepts the following values:
draftreturns the draft version of a document,publishedreturns the published version of a document.
Migrationβ
This section regroups useful notes and procedures about the introduced breaking change.
Notesβ
There are no fallbacks to return by default the published version, and return the draft version if no published version is found.
Migration procedureβ
- API calls initiated from the front end (REST API, GraphQL API) that used
publicationStateneed to be manually updated. - If
publicationStateis used in your custom back-end code with the Entity Service API in Strapi v4, a codemod will automatically handle the change for Strapi 5 (see Entity Service to Document Service migration reference for additional details).