How to query nested graphQL filter server side?

System Information
  • Strapi Version: 3.6.
  • Operating System: MacOS
  • Database: MongoDB
  • Node Version: v14.15.5
  • Yarn Version: 1.22.17
  • strapi-plugin-graphql: 3.6.8
  • strapi-connector-mongoose: 3.6.8

I’m trying to apply the same filter, that has been used in the graphQL request, later on on server side in a crone job. I can’t figure out, which service I should use. Let’s say, my graphQL query looks like this:

query ($where: JSON) {
  restaurants(where: $where) {    
    user {
      id
      email     
    }    
  }
}, variables: {
  "where": {
    "_where": {
      "_or": [
        {
          "user": {
            "email_contains": "@"
          }
        },
        {
          "user": {
            "email_contains": ".com"
          }
        }
      ]
    }
  }
}



When I try to use this in Strapi.find, Im getting an error. I tried to find a proper service in the graphQL plugin but I don’t get how it works. It’s not resolving the nested filters. For now I’m resolving them with my own written function to get matching IDs. Can somebody give me a hint, how to query graphQL filters in Strapi?