Skip to content

Starting a database transaction in a mutation contesxt #3380

Answered by DoctorJohn
francipvb asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, did you already take a look at the Strawberry extensions system?

You could possibly make use of the on_operation or on_execute lifecycle hooks to run code before and after execution of your resolvers. Via self.execution_context you should be able to figure out whether your operation is a query, mutation or subscription.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@francipvb
Comment options

Answer selected by francipvb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants