Skip to content

Commit

Permalink
Update wp-graphql-yoast-seo.php (#157)
Browse files Browse the repository at this point in the history
Fixes #150
  • Loading branch information
pascalroget authored May 29, 2023
1 parent 305df06 commit 78a6b81
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wp-graphql-yoast-seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,12 @@ function get_post_type_graphql_fields($post, array $args, AppContext $context)
'type' => 'SEOUser',
'description' => __('The Yoast SEO data of a user', 'wp-graphql-yoast-seo'),
'resolve' => function ($user, array $args, AppContext $context) {

// Author has no posts
if (!YoastSEO()->meta->for_author($user->userId)) {
return [];
}

$robots = YoastSEO()->meta->for_author($user->userId)->robots;

$schemaArray = YoastSEO()->meta->for_author($user->userId)->schema;
Expand Down

0 comments on commit 78a6b81

Please sign in to comment.