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
When I attempt to query the ID of a post in a relationship field as an anonymous user and the post is set to some non-public availability (i.e. private or draft), the query yields an error. I would expect the query would just give null in place of the given Post with no error.
To replicate, set up a Gutenberg block and an ACF Field Group for said block. Add a relationship field to the block. On a post, add the block to its content and select a private or draft post in the relationship field. Now do a GraphQL query on the post as an anonymous user. You will get an error.
Example query (where AcfRelatedContentBlock is my custom Gutenberg block and content_select is the Relationship field):
{
page(id: "some-test-page", idType: URI) {
blocks {
__typename
... on AcfRelatedContentBlock {
acf {
content_select {
__typename
... on Post {
id
}
}
}
}
}
}
}
When I attempt to query the ID of a post in a relationship field as an anonymous user and the post is set to some non-public availability (i.e. private or draft), the query yields an error. I would expect the query would just give
null
in place of the given Post with no error.To replicate, set up a Gutenberg block and an ACF Field Group for said block. Add a relationship field to the block. On a post, add the block to its content and select a private or draft post in the relationship field. Now do a GraphQL query on the post as an anonymous user. You will get an error.
Example query (where
AcfRelatedContentBlock
is my custom Gutenberg block andcontent_select
is the Relationship field):Example result:
Note that this happens for
uri
as well.The text was updated successfully, but these errors were encountered: