Skip to main content

decode_edge_cursor

Function decode_edge_cursor 

Source
pub fn decode_edge_cursor(cursor: &str) -> Option<i64>
Expand description

Decode a Relay edge cursor back to a BIGINT primary key value.

Returns None if the cursor is not valid base64 or does not contain a valid decimal integer.

ยงExample

use fraiseql_core::runtime::relay::{decode_edge_cursor, encode_edge_cursor};

let cursor = encode_edge_cursor(42);
assert_eq!(decode_edge_cursor(&cursor), Some(42));
assert_eq!(decode_edge_cursor("not-valid-base64!!"), None);