-
-
Notifications
You must be signed in to change notification settings - Fork 499
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description of the feature
I'd like to access my data in Context mutably. I understand it cannot be done in Queries, because they are run in parallel (and anyway it would be bad design to mutate in query). But I believe the very point of Mutations is the ability to change data, and this is why they are supposed to be executed sequentialy.
A bit related to #1478.
Code example (if possible)
struct MutationRoot;
#[MutableObject]
impl MutationRoot {
async fn do_smth(&self, ctx: &mut Context<'_>) -> Result<bool> {
let data = ctx.data_mut::<MyOwnData>()?;
data.change_smth();
Ok(true)
}
}
pub type FilesSchema = Schema<QueryRoot, MutationRoot, EmptySubscription>;
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request