Query to return all-or-nothing from an aggregation of uid sets

Could you produce a sample like this one below?

{
  "xids": [
    {
      "uid": "_:1xid",
      "value": "WhPlErd9WE1234562pb1yFjFHlewUIQwQ"
    },
    {
      "uid": "_:2xid",
      "value": "ahPlErd9WE1234562pb1yFjFHlewUIQwQ"
    },
    {
      "uid": "_:3xid",
      "value": "ehPlErd9WE1234562pb1yFjFHlewUIQwQ"
    }
  ],
  "nodes": [
      {
        "xid": {
          "uid": "_:1xid"
        },
        "firstName": "Tom",
        "lastName": "Cruise"
      },
      {
        "xid": {
          "uid": "_:2xid"
        },
        "firstName": "Maria",
        "lastName": "Sharapova"
      },
      {
        "xid": {
          "uid": "_:3xid"
        },
        "firstName": "Robert",
        "lastName": "Downey Jr."
      },
      {
        "xid": {
          "uid": "_:1xidNull"
        },
        "test": "1test"
      },
      {
        "xid": {
          "uid": "_:2xidNull"
        },
        "test": "2test"
      },
      {
        "xid": {
          "uid": "_:3xidNull"
        },
        "test": "3test"
      },
      {
        "xid": {
          "uid": "_:4xidNull"
        },
        "test": "4test"
      }
    ]
}

You could also use a “trick” with math functions e.g:

{
	var(func: has(firstName), first: 3) {
    uid
		a_count as count(xid)
	}
	var(func: has(test), first: 4) {
		t_count as count(xid)
	}
	var() {
	    a_sum as sum(val(a_count))
	    t_sum as sum(val(t_count))
	    total_sum as summm: math(t_sum + a_sum)
	}
      
	Checks() {
        lessOrEq : math(total_sum <= 7 )
        gt : math(total_sum > 7 )
	}
    returnAll(func: uid(a_count, t_count)) {
        uid
        expand(_all_)
    }
}

That is, “if less than or equal to” you use the result of the “returnAll” block. Otherwise, ignore it.

Result

"data": {
    "Checks": [
      {
        "lessOrEq": true
      },
      {
        "gt": false
      }
    ],
    "returnAll": [
      {
        "uid": "0x2711",
        "lastName": "Sharapova",
        "firstName": "Maria"
      },
      {
        "uid": "0x2712",
        "lastName": "Downey Jr.",
        "firstName": "Robert"
      },
      {
        "uid": "0x2716",
        "lastName": "Cruise",
        "firstName": "Tom"
      },
      {
        "uid": "0x271b",
        "test": "3test"
      },
      {
        "uid": "0x271c",
        "test": "4test"
      },
      {
        "uid": "0x271e",
        "test": "1test"
      },
      {
        "uid": "0x271f",
        "test": "2test"
      }
    ]
  }