Class PostObjectUnionType
Class PostObjectUnionType
In WordPress, relations can be set to a post object by ID, but in many cases there's no strict control over what post_type the related post can be, so in many cases it's unknown what "post_type" the related post is until the post has been queried and returned. Some examples of such relations are:
Posts can have a parent_id set, and the parent_id can be of any post_type, so it's unknown what type of postObject will be returned until the query has been run.
Attachments (mediaItems) can be uploaded to any post_type as well, so their "uploadedTo" property can return any type of post object.
- GraphQL\Type\Definition\UnionType
-
WPGraphQL\Type\Union\PostObjectUnionType
Namespace: WPGraphQL\Type\Union
Package: WPGraphQL\Type\Union
Since: 0.0.6
Located at Type/Union/PostObjectUnionType.php
Package: WPGraphQL\Type\Union
Since: 0.0.6
Located at Type/Union/PostObjectUnionType.php
Methods summary
public
|
|
public
array|null
|