oejp-api-example icon indicating copy to clipboard operation
oejp-api-example copied to clipboard

chore: update query

Open NowNewNao opened this issue 2 years ago • 1 comments

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: 🙇

NowNewNao avatar Jan 26 '23 00:01 NowNewNao

If you wanted to use costEstimate you'd have to update this bit with a new line: image And also update that dataclass's type with what cost estimate is (probably number?)

FraserTooth avatar Jan 26 '23 00:01 FraserTooth