async fn whoami(&self, context: &async_graphql::Context<'_>) -> Result<Option<User>> {
        let (db, token) = Context::parse(context)?;
        let user_id = validate_token(&require_token(&token)?)?;

        let result = User::collection(&db)
            .find_one(doc! { "_id": user_id }, None)
            .await?;
        Ok(result)
    }
/// The user that reflects the authorization token
The user that reflects the authorization token
The user that reflects the authorization token
async fn whoami(&self, context: &async_graphql::Context<'_>) -> Result<Option<User>> {
        let (db, token) = Context::parse(context)?;
        let user_id = validate_token(&require_token(&token)?)?;
        let result = User::collection(&db)
            .find_one(doc! { "_id": user_id }, None)
            .await?;
        Ok(result)
    }
async fn whoami ( & self , context : & async_graphql :: Context < ' _ > ) -> Result < Option < User > > { let ( db , token ) = Context :: parse ( context ) ? ; let user_id = validate_token ( & require_token ( & token ) ? ) ? ; let result = User :: collection ( & db ) . find_one ( doc ! { " " user_id } , None ) . await ? ; Ok ( result ) }
The user that reflects the authorization token
The user that reflects the authorization token
&self
context
&async_graphql::Context<'_>
&self
context
&async_graphql::Context<'_>