Skip to main content

hasura_session_document

Function hasura_session_document 

Source
pub fn hasura_session_document(
    session: &HashMap<String, String>,
    role: &str,
) -> Value
Expand description

The session as a function reading hasura_session expects it.

Hasura hands a function a JSON object of the caller’s session variables under the names they arrive as – x-hasura-role, x-hasura-user-id – which is what a function body indexes into. They are held stripped and lowercased for the settings a row-level policy reads, so the prefix goes back on here.