fn viewer(context: &Context) -> Result<User, GraphQLError> {
        match repositories::UserRepository::find_one(context.viewer.id(), &context.db_pool) {
            Err(e) => Err(GraphQLError::InternalServerError(e)),
            Ok(None) => Err(GraphQLError::UserNotFound),
            Ok(Some(user)) => Ok(user.into()),
        }
    }
// FIXME: Extract domain and repository logic to own module
/// The authenticated user.
/// This is a user context dependant query.
Extract domain and repository logic to own module
The authenticated user.
This is a user context dependant query.
Extract domain and repository logic to own module The authenticated user . This is a user context dependant query .
fn viewer(context: &Context) -> Result<User, GraphQLError> {
        match repositories::UserRepository::find_one(context.viewer.id(), &context.db_pool) {
            Err(e) => Err(GraphQLError::InternalServerError(e)),
            Ok(None) => Err(GraphQLError::UserNotFound),
            Ok(Some(user)) => Ok(user.into()),
        }
    }
fn viewer ( context : & Context ) -> Result < User , GraphQLError > { match repositories :: UserRepository :: find_one ( context . viewer . id ( ) , & context . db_pool ) { Err ( e ) => Err ( GraphQLError :: InternalServerError ( e ) ) , Ok ( None ) => Err ( GraphQLError :: UserNotFound ) , Ok ( Some ( user ) ) => Ok ( user . into ( ) ) , } }
FIXME: Extract domain and repository logic to own module
The authenticated user.
FIXME : Extract domain and repository logic to own module The authenticated user .
context
&Context
context
&Context