Filter on relation data in backend

System Information
  • Strapi Version: 3.5.3
  • Operating System: Mac OSX
  • Database: MongoDB
  • Node Version: v12.14.0
  • NPM Version: 6.13.4
  • Yarn Version: -

So with graphQL im able to search for entries based on a nested search;

query photoByName($name: String!){
            photos(where: {photo: {name:$name}}) {

Which gets the photos with where the name of the image that is linked to that entry.

How can i do this in the strapi backend?