Skip to Content
Octopus Energy Packages
Concepts

Fetching

How measurement data enters the package

Fetching is the bridge between your app's GraphQL client and the package's normalized measurement records. The package keeps this layer deliberately small: you provide the client and resolved inputs, it returns data that the rest of the pipeline can use.

Inputs

Measurement fetching depends on three main inputs:

InputPurpose
GraphQL clientlets the package request data without owning your client setup
Timeframeprovides the resolved date bounds to fetch
Market supply pointsdescribe which supplies and utilities are in scope

This keeps fetching separate from state management and UI rendering.

Imperative or React Query

The same underlying operation is available in two styles:

  • fetchMeasurements from @octopus-energy/measurements for server code, loaders, tests, and scripts
  • measurementsQueryOptions from @octopus-energy/measurements/react-query for TanStack Query usage

Use whichever style fits the part of the app you are building.

Output

Fetching returns MeasurementRecord[]. The records stay normalized so they can be filtered, grouped, transformed into overview data, transformed into summary data, or adapted to a custom UI.

Where to go next

On this page