{"record":{"id":"f155ad6f184aa30a","repo":"hasura/graphql-engine","slug":"the-session-variables-session-variable-is-not-en","errorCode":null,"errorMessage":"The session variables {session_variable} is not encoded as a string. JSON-typed session variables are not supported unless you update your compatibility date","messagePattern":"The session variables (.+?) is not encoded as a string\\. JSON-typed session variables are not supported unless you update your compatibility date","errorType":"exception","errorClass":"InternalDeveloperError::VariableJsonNotSupported","httpStatus":null,"severity":"error","filePath":"v3/crates/plan/src/error.rs","lineNumber":38,"sourceCode":"}\n\nimpl TraceableError for InternalError {\n    fn visibility(&self) -> ErrorVisibility {\n        match self {\n            Self::Developer(error) => error.visibility(),\n            Self::Engine(_) => ErrorVisibility::Internal,\n        }\n    }\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum InternalDeveloperError {\n    #[error(\"Required session variable not found in the request: {session_variable}\")]\n    MissingSessionVariable {\n        session_variable: SessionVariableName,\n    },\n\n    #[error(\n        \"The session variables {session_variable} is not encoded as a string. JSON-typed session variables are not supported unless you update your compatibility date\"\n    )]\n    VariableJsonNotSupported {\n        session_variable: SessionVariableName,\n    },\n\n    #[error(\n        \"Session variable {session_variable} value is of an unexpected type. Expected: {expected}, but found: {found}\"\n    )]\n    VariableTypeCast {\n        session_variable: SessionVariableName,\n        expected: String,\n        found: String,\n    },\n\n    #[error(\n        \"Typecasting session variable {session_variable} to an array is not supported. Update your compatibility date to enable JSON session variables\"\n    )]","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/plan/src/error.rs#L20-L56","documentation":"The plan crate received a session variable whose value is a JSON object/array rather than a plain string, but the project's compatibility date is older than JSON session variable support, so only string-encoded values are allowed.","triggerScenarios":"A request sends a session variable as a JSON value (object/array) via a bulk/JSON transport while the engine's compatibility date predates the JSON-session-variables feature; typecasting or reading that variable then fails with this error.","commonSituations":"Clients migrated to a newer protocol that JSON-encodes session variables while the project still pins an old compatibility date; copying newer example requests into an older project.","solutions":["Update the project's compatibility date to one that enables JSON session variables","Or send session variables as plain string values (headers) as the older protocol expects","Align client SDK version with the engine/compatibility date"],"exampleFix":"# before\ncompatibility_date: \"2024-01-01\"  # before JSON session var support\n# after\ncompatibility_date: \"2025-01-01\"  # enables JSON session variables","handlingStrategy":"validation","validationCode":"// Only send JSON-encoded session variables when compatibility date allows it\nlet allow_json = compatibility_date >= JSON_SESSION_VARS_DATE;\nif !allow_json { send_session_vars_as_strings(&mut request); }","typeGuard":null,"tryCatchPattern":"match err {\n    InternalDeveloperError::VariableJsonNotSupported { session_variable } => {\n        // resend the variable as a plain string value\n    }\n    _ => {}\n}","preventionTips":["Keep compatibility date aligned with the newest engine feature you use","Test transports with the exact compatibility date used in production"],"tags":["session-variables","compatibility-date","versioning","hasura"],"backgroundTag":"compatibility-date-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}