You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GraphQL: Cannot set draft on nested relations. Can set draft where draft is not enabled. #4985
In Payload v2.16.1, I no longer experience it with the REST API and if I manually add the draft variable to each relationship; however, I am not getting the cascading behavior noted in #6141.
And you open http://127.0.0.1:3000/api/graphql-playground and query:
{
Menu(draft: true) {
relationship {
text
}
}
}
The output is published example post, but if the draft variable is set on the relationship, it will return the draft:
I also ran into this with Rich Text links that are relationships. At least with the Slate editor and GraphQL, there isn't a draft variable, and will always return the published version (or the first draft if no published version exists).
This prevents rich text relationship links from working if the linked document location changed since the linked document was last published (or since the first draft if no published version exists)
@JarrodMFlesch would it be best to reopen this issue, or shall I create new issues to track these sub-issues?
Activity
evelynhathaway commentedon May 13, 2024
I was running into this with an without GraphQL in #3963 (reply in thread).
In Payload v2.16.1, I no longer experience it with the REST API and if I manually add the draft variable to each relationship; however, I am not getting the cascading behavior noted in #6141.
JarrodMFlesch commentedon May 14, 2024
@evelynhathaway I just tested this and it seems to be working. Can you provide more context? Or possibly a small reproduction?
evelynhathaway commentedon May 14, 2024
@JarrodMFlesch I think the difference is that I am using a global maybe?
With this repro: evelynhathaway@9bd24ff
And you open
http://127.0.0.1:3000/api/graphql-playgroundand query:{ Menu(draft: true) { relationship { text } } }The output is
published example post, but if the draft variable is set on the relationship, it will return the draft:{ Menu(draft: true) { relationship(draft: true) { text } } }evelynhathaway commentedon May 28, 2024
I also ran into this with Rich Text links that are relationships. At least with the Slate editor and GraphQL, there isn't a
draftvariable, and will always return the published version (or the first draft if no published version exists).This prevents rich text relationship links from working if the linked document location changed since the linked document was last published (or since the first draft if no published version exists)
@JarrodMFlesch would it be best to reopen this issue, or shall I create new issues to track these sub-issues?
JarrodMFlesch commentedon May 29, 2024
@evelynhathaway yes that would be super helpful actually!
evelynhathaway commentedon Jun 5, 2024
Created #6642 and #6643 for the discussed sub-issues
github-actions commentedon Sep 7, 2024
This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.