Thread
#prefect-community
    Stéphan Taljaard

    Stéphan Taljaard

    7 months ago
    Hi Why does this GQL query return "empty results"? I expect there to be only one, since the query filters the flow runs by id?
    query {
      flow(where: { name: { _ilike: "Energy Insight" } }) {
        flow_runs(where: {name: {_eq: "stalwart-ostrich"}}) {
          name
          id
        } 
      }
    ->
    {
      "data": {
        "flow": [
          {
            "flow_runs": []
          },
          {
            "flow_runs": []
          },
          {
            "flow_runs": []
          },
          {
            "flow_runs": []
          },
          {
            "flow_runs": []
          },
          {
            "flow_runs": [
              {
                "name": "stalwart-ostrich",
                "id": "8bca3ab2-05cc-4223-93f0-071813528545"
              }
            ]
          }
        ]
      }
    }
    I see the key is in the name being flow_run_s_ This query does return only one:
    query {
      flow_run(where: {name: {_eq: "stalwart-ostrich"}}){
        name
        id
      }
    }
    But it still feels strange to me that the former returns those empty ones even if they didn't have a matching ID?
    Kevin Kho

    Kevin Kho

    7 months ago
    I think that is because your first flow query returns previous versions of the Flow as well. You can set
    archived=False
    to only get the latest one. And then those previous versions don’t have any flow runs with matching names