query getUserForIPAndTimestamp($timeFrom: DateTime, $timeTo: DateTime, $ip: String) {
    getRadiusUserAccountingRecordList(
        filter: [
            {AND: [
                {OR: {startTime: {lte: $timeTo}, stopTime: {gte: $timeFrom}}},
                {OR: {startTime: {lte: $timeTo}, stopTime: {isnull: true}}}
            ]},
            {AND: [
                {OR: {framedIpAddress: {netContainsOrEquals: $ip}}},
                {OR: {nasIpIdentifier: {netContainsOrEquals: $ip}}},
            ]}
        ]
    ) {
        data {
            startTime
            framedIpAddress {
                exploded
            }
            username
        }
    }
 	getEduVpnUserAccountingRecordList(
        filter: [
            {AND: [
                {OR: {connectedAt: {lte: $timeTo}, disconnectedAt: {gte: $timeFrom}}},
                {OR: {connectedAt: {lte: $timeTo}, disconnectedAt: {isnull: true}}}
            ]},
            {AND: [
                {OR: {ipV4Address: {netContainsOrEquals: $ip}}},
                {OR: {ipV6Address: {netContainsOrEquals: $ip}}},
            ]}
        ]
    ) {
        data {
            startTime: connectedAt
            framedIpAddress: ipV4Address {
                exploded
            }
            framedIpV6Address: ipV6Address {
                exploded
            }
            username: userId
        }
    }
}

query getIPAddressID($ip: String) {
    __typename
    getIpAddressList(filter: {AND: {OR: {ipAddress: {exact: $ip}}}}, limit: 1){
        data{
            id
        }
    }
}
