diff --git a/src/class-config.php b/src/class-config.php index 927f2b3..058a594 100644 --- a/src/class-config.php +++ b/src/class-config.php @@ -687,7 +687,7 @@ protected function register_graphql_field( string $type_name, string $field_name if ( ! empty( $value ) && is_array( $value ) ) { foreach ( $value as $post_id ) { $post_object = get_post( $post_id ); - if ( $post_object instanceof \WP_Post ) { + if ( $post_object->post_status == 'publish' && $post_object instanceof \WP_Post ) { $post_model = new Post( $post_object ); $relationship[] = $post_model; }