Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-4109: Handled deleted users resolving #131

Merged
merged 2 commits into from
Feb 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/GraphQL/Resolver/UserResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
*/
namespace EzSystems\EzPlatformGraphQL\GraphQL\Resolver;

use eZ\Publish\API\Repository\Exceptions\NotFoundException;
use eZ\Publish\API\Repository\LocationService;
use eZ\Publish\API\Repository\UserService;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\User\User;
use eZ\Publish\API\Repository\Values\User\UserGroup;

/**
Expand Down Expand Up @@ -46,9 +48,13 @@ public function resolveUser($args)
}
}

public function resolveUserById($userId)
public function resolveUserById($userId): ?User
{
return $this->userService->loadUser($userId);
try {
return $this->userService->loadUser($userId);
} catch (NotFoundException $e) {
return null;
barw4 marked this conversation as resolved.
Show resolved Hide resolved
}
}

/**
Expand Down