Strapi error for backend customization: Undefined attribute level operator id

As for me I have to specify the request data before sending it

:x: Not working

const profile = await strapi.db.query("api::profile.profile").findOne({
    where: {
        user: ctx.state.user,
    },
    select: ["id"],
});

:white_check_mark: Works fine

const profile = await strapi.db.query("api::profile.profile").findOne({
    where: {
        user: {
            id: ctx.state.user.id,
        }
    },
    select: ["id"],
});