Title: Duplicate Entries for Published and Draft Content in Strapi

Hello, Strapi Community!

I’m facing an issue with content creation and publishing in Strapi. When I create a new wine product and publish it, two entries appear in the database:

Draft Entry: publishedAt is null.
Published Entry: publishedAt has a valid timestamp.
Workflow:
Creating a New Wine: I create a product in the Strapi admin panel.
Publishing the Wine: I publish the product after saving.
Checking the database (data.db), I find both entries, leading to confusion.

Example GraphQL Query:

query Query($status: PublicationStatus) { wines(status: $status) { documentId title createdAt updatedAt publishedAt } }

Variables:

For drafts: { “status”: “DRAFT” }
For published: { “status”: “PUBLISHED” }

Observed Behavior:
Querying drafts returns both draft and published entries.
Multiple entries for the same wine product complicate data management.

Questions:

  1. Is this expected behavior in Strapi?
  2. How can I retrieve only published entries without duplicates?
  3. What are the best practices for managing content lifecycle to avoid duplicates?

Thank you for your help!

This topic has been created from a Discord post (1300096076610801694) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

1 Like

Same problem here!

This is very important to me. I believe it’s a bug in Strapi, and I hope they’ll fix it soon

will this help? GraphQL API | Strapi 5 Documentation

First of all, thank you for your response! However, I noticed an issue: when I pass the DRAFT status to retrieve only drafted products, I’m still getting all products, including those with statuses of both DRAFT and PUBLISHED. Oddly, both types have publishedAt: null, which doesn’t seem logical.

It appears this issue is due to data duplication after publishing a product. Once a product is published, I end up with two entries: one with publishedAt: null and one as expected.

The core problem seems to be this duplication and the unexpected results in the publishedAt field, even though the logic for filtering by status otherwise works as intended. Could you help clarify why this is happening and how to ensure accurate data?

that’s quite strange indeed. No idea why sorry