query getIPData {
  {%- for i, ip in ips %}
  ip_{{ i }}: getNetboxIpAddressList(filter: {AND: {OR: {cidr: {host: "{{ ip }}"}}}}) {
    ...ipAddressFields
  }
  prefix_{{ i }}: getNetboxPrefixList(filter: {AND: {OR: {cidr: {netContains: "{{ ip }}"}}}}) {
    ...prefixFields
  }
  {% endfor %}
}

fragment ipAddressFields on NetboxIPAddressGroupPaginated {
  data {
    cidr {
      raw_exploded: exploded
    }
    detail {
      data {
        description
      }
    }
    tenant {
      detail {
        data {
          name
        }
      }
    }
  }
}

fragment prefixFields on NetboxPrefixGroupPaginated {
  data {
    cidr {
      raw_exploded: exploded
    }
    detail {
      data {
        description
      }
    }
    tenant {
      detail {
        data {
          name
        }
      }
    }
  }
}