Skip to content

Conversation

@pwizla
Copy link
Collaborator

@pwizla pwizla commented May 2, 2024

This PR:

  • updates the docs for connect, disconnect, and set to use documentIds instead of ids
  • adds a callout to Document Service API with a short example so that users know it works "the same" as with the REST API

@vercel
Copy link

vercel bot commented May 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2024 3:11pm

@pwizla pwizla requested a review from Marc-Roig May 2, 2024 13:15
@pwizla pwizla self-assigned this May 2, 2024
@pwizla pwizla added internal PRs created by the Strapi core team v5 Documentation PR that targets Strapi v5 labels May 2, 2024
@pwizla pwizla added this to the 5.0.0 (stable) milestone May 2, 2024
Copy link
Contributor

@Marc-Roig Marc-Roig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs looks good !

There are more complex scenarios that we might want to document , maybe they are more advanced and not as useful for the majority, but they might be useful to know.

  • Relation from Category (i18n off) -> Article (i18n on):
    In this situation you can select which locale you are connecting
data: {
    categories: {
      connect: [
        { documentId: 'z0y2x4w6v8u1t3s5r7q9onm', locale: 'en' },
       { documentId: 'z0y2x4w6v8u1t3s5r7q9onm', locale: 'fr' }, // Connect to the same document id but different locale
      ]
   }
}
  • Relation from Category (D&P off) -> Article (D&P on):
    (Probably less relevant than the first one)
data: {
    categories: {
      connect: [
        { documentId: 'z0y2x4w6v8u1t3s5r7q9onm', status: 'draft' },
       { documentId: 'z0y2x4w6v8u1t3s5r7q9onm', status: 'published' }, // Connect to the same document id but different publication states
      ]
   }
}

Note, on any api we expose the "documentId", the user will be able to reference both locale and status .

@pwizla pwizla merged commit 2be4eb9 into next Jun 11, 2024
@pwizla pwizla deleted the v5/relations-updates branch June 11, 2024 15:04
@pwizla pwizla modified the milestones: 5.0.0 (stable), 5.0.0-rc.0 Jun 26, 2024
@pwizla pwizla modified the milestones: 5.0.0-rc.0, 5.0.0 (stable) Aug 13, 2024
@pwizla pwizla added pr: updated content PRs updating existing documentation content source: Dev Docs PRs/issues targeting the Developer Docs labels Aug 13, 2024
@pwizla pwizla changed the title [Strapi 5] Updates to relations in API docs Updates to relations in API docs Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal PRs created by the Strapi core team pr: updated content PRs updating existing documentation content source: Dev Docs PRs/issues targeting the Developer Docs v5 Documentation PR that targets Strapi v5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants