oejp-api-example
oejp-api-example copied to clipboard
chore: update query
Summary
This PR updates example of halfHourlyReadings
query, which was updated on the prod.
-
costEstimate
added as return value -
productCode
is required as one of the query variables
GET_HH_BODY = """
query halfHourlyReadings($accountNumber: String!, $fromDatetime: DateTime, $toDatetime: DateTime, $productCode: String!) {
account(accountNumber: $accountNumber) {
properties {
electricitySupplyPoints {
halfHourlyReadings(fromDatetime: $fromDatetime, toDatetime: $toDatetime, productCode: $productCode) {
startAt
endAt
version
value
costEstimate
}
}
}
}
}
"""
🤚 Need help
I updated body in octopus.py
, but I assume I also need to maintain other place as well such as something like setting def get_product_code(???) -> str:
🙇
If you wanted to use costEstimate
you'd have to update this bit with a new line:
And also update that dataclass's type with what cost estimate is (probably number?)