use devsper_core::GraphMutation;
use tokio::sync::oneshot;
pub struct MutationRequest {
pub mutation: GraphMutation,
pub response: oneshot::Sender<MutationResult>,
}
#[derive(Debug)]
pub enum MutationResult {
Applied,
Rejected { reason: String },
}
impl MutationRequest {
pub fn new(mutation: GraphMutation) -> (Self, oneshot::Receiver<MutationResult>) {
let (tx, rx) = oneshot::channel();
(Self { mutation, response: tx }, rx)
}
}