Open evelynhathaway opened 5 months ago
Hey @evelynhathaway I'm not able to reproduce this issue.
In draft mode, doc b links to doc a with slug a2
and in non-draft mode, doc b links to doc a with slug a
. a2
coming from the draft version, and a
coming from the published version. So this works as expected:
https://github.com/payloadcms/payload/assets/70709113/51c06e9f-67b1-415a-ba56-1f6d8bd0a242
I did test this on payload v2.21.0 and @payloadcms/richtext-slate 1.5.2. Could you upgrade to these versions and see if that fixes it for you? If it does not, could you provide me with a repository which reproduces this, optimally with a small int test?
Link to reproduction
No response
Describe the Bug
Links that are relationships inside a rich text field links do not return drafts if the parent query has the draft parameter. The specific rich text field doesn't provide a draft parameter to GraphQL either.
The result is that all rich text relationship links will always return the published version (or the first draft if no published version exists).
This solves unexpected behavior like broken rich text relationship links in our frontend if the linked document location changed since the linked document was last published (or since the first draft if no published version exists).
Similar functionality was added to first class relationship fields as part of: #4985
To Reproduce
Payload Version
v2.16.1
Adapters and Plugins
Slate Editor, MongoDB