How to filter data by relation in Strapi v4

if you are using JS template string then use double back slash before [ , ] . like this…

http://localhost:1337/api/questions?filters\\[users_permissions_user\\][username][$contains]=johndoe