How could I add a query string param in middleware?

Found an example in the forums

Used a middleware to set the author

And a policy to mutate the queries