{"record":{"id":"04aa4d41b2769b87","repo":"FuelLabs/fuel-core","slug":"can-not-use-pagination-when-balances-indexation-is","errorCode":null,"errorMessage":"Can not use pagination when balances indexation is not available","messagePattern":"Can not use pagination when balances indexation is not available","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/schema/balance.rs","lineNumber":120,"sourceCode":"    #[graphql(complexity = \"if query_costs().balance_query == 0 { \\\n        (child_complexity as f32 * first.unwrap_or_default() as f32 * 0.66) as usize + \\\n        (child_complexity as f32 * last.unwrap_or_default() as f32 * 0.66) as usize\n    } else { query_costs().balance_query }\")]\n    async fn balances(\n        &self,\n        ctx: &Context<'_>,\n        filter: BalanceFilterInput,\n        first: Option<i32>,\n        after: Option<String>,\n        last: Option<i32>,\n        before: Option<String>,\n    ) -> async_graphql::Result<Connection<AssetId, Balance, EmptyFields, EmptyFields>>\n    {\n        let query = ctx.read_view()?;\n        if !query.indexation_flags.contains(&IndexationKind::Balances)\n            && (before.is_some() || after.is_some())\n        {\n            return Err(anyhow!(\n                \"Can not use pagination when balances indexation is not available\"\n            )\n            .into())\n        }\n        let base_asset_id = *ctx\n            .data_unchecked::<ChainInfoProvider>()\n            .current_consensus_params()\n            .base_asset_id();\n        let owner = filter.owner.into();\n        crate::schema::query_pagination(after, before, first, last, |start, direction| {\n            Ok(query\n                .balances(&owner, (*start).map(Into::into), direction, &base_asset_id)\n                .map(|result| {\n                    result.map(|balance| (balance.asset_id.into(), balance.into()))\n                }))\n        })\n        .await\n    }","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/schema/balance.rs#L102-L138","documentation":"Error \"Can not use pagination when balances indexation is not available\" thrown in FuelLabs/fuel-core.","triggerScenarios":"Thrown at crates/fuel-core/src/schema/balance.rs:120 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}