Skip to content

Update documentation for use of document ID in Strapi 5 #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,15 @@ import MigrationIntro from '/docs/snippets/breaking-change-page-migration-intro.

In Strapi 5, the underlying API handling content is the [Document Service API](/cms/api/document-service) and documents should be called by their `documentId` in Content API calls (REST API & GraphQL).

<Intro />

<BreakingChangeIdCard
plugins
codemodPartly
codemodName="entity-service-document-service"
codemodLink="https://github.com/strapi/strapi/blob/develop/packages/utils/upgrade/resources/codemods/5.0.0/entity-service-document-service.code.ts"
/>



## Breaking change description

<SideBySideContainer>

<SideBySideColumn>



**In Strapi v4**

Expand Down Expand Up @@ -58,9 +53,9 @@ Entries were identified by their `id`:
}
```

</SideBySideColumn>

<SideBySideColumn>



**In Strapi 5**

Expand All @@ -87,18 +82,18 @@ Documents are identified by their `documentId`:
}
```

</SideBySideColumn>

</SideBySideContainer>



## Migration

<MigrationIntro />


### Notes

- This breaking change impacts routes and relations.
- To ease the transition from v4 to Strapi 5, API calls to entries might still include an `id` field in their response, especially with the [Document Service API](/cms/api/document-service). But it's recommended that you start making an habit of using `documentId` instead of `id` as it will ease handling the transition to future Strapi versions.
- To ease the transition from v4 to Strapi 5, API calls to entries might still include an `id` field in their response, especially with the [Document Service API](/cms/api/document-service). But it's recommended that you start making a habit of using `documentId` instead of `id` as it will ease handling the transition to future Strapi versions.

### Migration procedure

Expand Down