How could I add a query string param in middleware?

System Information
  • Strapi Version: 4
  • Operating System: OsX
  • Database: Mysql
  • Node Version:
  • NPM Version:
  • Yarn Version:

Hi Guys,
I am starting with Strapi trying to create a small application. I wanted to list the articles of a logged in user without having to pass the query from the frontend. I thought about creating a middleware that takes the user id from the jwt. I get the id perfectly, but I don’t know how to incorporate the corresponding where to the request. can you help me?

Thanks in advance


Found an example in the forums

Used a middleware to set the author

And a policy to mutate the queries