Filter On Expand Data

To facilitate better answering of questions, if you have a question, please fill in the following info. Otherwise, please delete the template.

I wanted to filter the Expanded data

Please list the high level idea of what you want to do

What I did

Please list the things you have tried.
Query

{
    feed(func: type(Moment), 
          first: 2, 
          offset: 0, 
          orderdesc: posted_at)
          @filter(eq(is_hidden, 0) AND 
            eq(category, "moment") AND
            eq(is_curated, false) AND
            NOT has(vendor_id))
              
             {
            uid
            expand(Moment){
              uid
             @filter(eq(media_type, 4)) 
              expand(Media) 
             
             }
            _location: ~moments {
              uid
              expand(Location)
              _trip: ~locations {
                uid
                expand(Trip)
              	
               
                
              }
            }
          }
}

I want to filter the feed on the Basis of media_type 4 in media

dgraph version

Response

{
  "data": {
    "feed": [
      {
        "uid": "0x7952c",
        "updated_at": "2022-09-18T15:32:48.383Z",
        "created_at": "2022-09-18T15:32:48.383Z",
        "description": "",
        "_id": "63273a2090e808002a225aa2",
        "media": [
          {
            "uid": "0x7952d",
            "updated_at": "2022-09-18T15:32:48.975Z",
            "height": 810,
            "created_at": "2022-09-18T15:32:48.975Z",
            "media_type": 1,
            "path": "public/production/moments/63273a2090e808002a225aa2/13ab76be-1d1e-4a84-b274-d3c2b303e56b.jpg",
            "_id": "63273a2090e808002a225aa8",
            "width": 1080,
            "moment": "63273a2090e808002a225aa2",
            "caption": "With friends who are more than family! At the Irish House Belgaum!!"
          }
        ],
        "is_hidden": 0,
        "location": "63273a2090e808002a225aa0",
        "category": "moment",
        "is_curated": false,
        "clicked_at": 1663438728,
        "posted_at": 1663515168,
        "_location": [
          {
            "uid": "0x79529",
            "arrival": "1663438728",
            "pressure": 1013,
            "day": "63251e14fb46a9002b36dc5c",
            "is_untagged": 0,
            "_id": "63273a2090e808002a225aa0",
            "category": "moment",
            "street": "Old PB Road",
            "area": "Kakati",
            "cumulative_distance": 605741.619809,
            "created_at": "2022-09-18T15:32:48.333Z",
            "latitude": 15.928292,
            "longitude": 74.527991,
            "temperature": 19.68,
            "district": "Belagavi",
            "altitude": 746.419128,
            "is_hidden": 0,
            "departure": "1663438728",
            "pincode": "591113",
            "is_deleted": 0,
            "state": "Karnataka",
            "humidity": 97,
            "distance": 0,
            "country": "India",
            "confirm_location": 1,
            "city": "Belagavi",
            "updated_at": "2022-09-18T15:32:48.333Z",
            "trip": "63251e14fb46a9002b36dc59",
            "_trip": [
              {
                "uid": "0x788de",
                "updated_at": "2022-09-17T01:08:36.416Z",
                "created_at": "2022-09-17T01:08:36.416Z",
                "_id": "63251e14fb46a9002b36dc5c"
              }
            ]
          }
        ]
      },
      {
        "uid": "0x7952a",
        "updated_at": "2022-09-18T15:32:47.964Z",
        "created_at": "2022-09-18T15:32:47.964Z",
        "description": "",
        "_id": "63273a1f90e808002a225a9e",
        "media": [
          {
            "uid": "0x7952b",
            "updated_at": "2022-09-18T15:32:48.567Z",
            "height": 810,
            "created_at": "2022-09-18T15:32:48.567Z",
            "media_type": 1,
            "path": "public/production/moments/63273a1f90e808002a225a9e/074a5444-9b48-47b2-9a6d-d4ed3f6b6dbf.jpg",
            "_id": "63273a2090e808002a225aa4",
            "width": 1080,
            "moment": "63273a1f90e808002a225a9e",
            "caption": "With friends who are more than family! At the Irish House Belgaum!!"
          }
        ],
        "is_hidden": 0,
        "location": "63273a1f90e808002a225a9c",
        "category": "moment",
        "is_curated": false,
        "clicked_at": 1663438697,
        "posted_at": 1663515167,
        "_location": [
          {
            "uid": "0x79528",
            "arrival": "1663438697",
            "pressure": 1013,
            "day": "63251e14fb46a9002b36dc5c",
            "is_untagged": 0,
            "_id": "63273a1f90e808002a225a9c",
            "category": "moment",
            "street": "Old PB Road",
            "area": "Kakati",
            "cumulative_distance": 605741.619809,
            "created_at": "2022-09-18T15:32:47.916Z",
            "latitude": 15.928292,
            "longitude": 74.527991,
            "temperature": 19.68,
            "district": "Belagavi",
            "altitude": 746.419128,
            "is_hidden": 0,
            "departure": "1663438697",
            "pincode": "591113",
            "is_deleted": 0,
            "state": "Karnataka",
            "humidity": 97,
            "distance": 0,
            "country": "India",
            "confirm_location": 1,
            "city": "Belagavi",
            "updated_at": "2022-09-18T15:32:47.916Z",
            "trip": "63251e14fb46a9002b36dc59",
            "_trip": [
              {
                "uid": "0x788de",
                "updated_at": "2022-09-17T01:08:36.416Z",
                "created_at": "2022-09-17T01:08:36.416Z",
                "_id": "63251e14fb46a9002b36dc5c"
              }
            ]
          }
        ]
      }
    ]
  },
  "extensions": {
    "server_latency": {
      "parsing_ns": 202148,
      "processing_ns": 1029567814,
      "encoding_ns": 677918,
      "assign_timestamp_ns": 1312707,
      "total_ns": 1031958056
    },
    "txn": {
      "start_ts": 3175893741
    },
    "metrics": {
      "num_uids": {
        "": 116784,
        "_id": 7,
        "_total": 233739,
        "accuracy": 2,
        "active": 1,
        "additional_tags": 1,
        "altitude": 2,
        "area": 2,
        "arrival": 2,
        "auto_moment": 2,
        "auto_trip_description": 1,
        "auto_trip_title": 1,
        "bg_color": 2,
        "caption": 2,
        "category": 29200,
        "city": 2,
        "clicked_at": 2,
        "confirm_location": 2,
        "content": 1,
        "country": 2,
        "cover_image": 1,
        "created_at": 7,
        "cumulative_distance": 2,
        "dash_path": 2,
        "day": 2,
        "days": 1,
        "default_cover": 1,
        "deleted": 1,
        "departure": 2,
        "description": 5,
        "dest_location": 1,
        "dgraph.type": 0,
        "distance": 2,
        "district": 2,
        "end_date": 1,
        "end_latitude": 1,
        "end_location": 1,
        "end_longitude": 1,
        "expires_at": 2,
        "free_tracker": 1,
        "has_trophy": 1,
        "height": 2,
        "humidity": 2,
        "imei": 1,
        "is_app_tracker": 1,
        "is_curated": 29199,
        "is_deleted": 2,
        "is_hidden": 29200,
        "is_untagged": 2,
        "latitude": 3,
        "location": 2,
        "locations": 1,
        "longitude": 3,
        "media": 2,
        "media_type": 2,
        "mode": 1,
        "moment": 2,
        "moments": 2,
        "offline_sync": 1,
        "path": 2,
        "pincode": 2,
        "posted_at": 2,
        "pressure": 2,
        "privacy": 1,
        "resync": 1,
        "ride_with_jawa": 1,
        "ride_with_jawa_toggle_on": 1,
        "route_name": 1,
        "s3_key": 2,
        "star": 1,
        "start_date": 1,
        "start_location": 1,
        "state": 2,
        "static_map": 1,
        "status": 1,
        "street": 2,
        "sync_status": 1,
        "tags": 1,
        "temperature": 2,
        "text_color": 2,
        "thumbnail": 2,
        "title": 1,
        "trip": 2,
        "uid": 7,
        "updated_at": 7,
        "user": 1,
        "uuid": 1,
        "vendor_id": 29199,
        "width": 2,
        "~locations": 2,
        "~moments": 2
      }
    }
  }
}

Sorry, I quite understand in part. But feels like you wanna say something else with this query. Can you explain?

BTW, it is not possible to add filters in expand. There is an open issue for that.