The expression return $id === 123 ? new...\Model\User($id) : null also could return the type GraphQLTests\Doctrine\Blog\Model\User which is incompatible with the return type mandated by Doctrine\Common\Persiste...bjectRepository::find() of object|null.