This shouldn't be the case... What exactly do you mean by a document being published?
As long as you can query it through Sanity's API (or @sanity/client, or the vision studio plugin), and the document doesn't have a drafts.
in their _id (in which case they're drafts), the document is already published.
If you added dots/periods to the _id of your created documents in client.create()
(ex: migrated.post.random-string
), this could be the culprit. These portions separated by periods are _id paths, which by default are only accessible by authenticated users with read rights.
That means you won't be able to get this data in your front-end(s) unless you use a robot token, which is why drafted documents (_id = drafts.rest-of-id
) don't show up there.
Does this clarify the issue in any way? Let me know how else I can help