Skip to main content

encode_edge_cursor

Function encode_edge_cursor 

Source
pub fn encode_edge_cursor(pk: i64) -> String
Expand description

Encode a BIGINT primary key value as a Relay edge cursor.

The cursor is base64(pk_string) where pk_string is the decimal representation of the BIGINT. Base64 is encoding, not encryption — a client that decodes the cursor will see the raw integer PK value. The Relay spec requires cursors to be treated as opaque by convention, but provides no cryptographic guarantee.

§Example

use fraiseql_core::runtime::relay::encode_edge_cursor;

let cursor = encode_edge_cursor(42);
assert_eq!(cursor, base64_of("42"));