{"record":{"id":"bd3cee9d73c7a9a2","repo":"hasura/graphql-engine","slug":"preset-argument-argument-name-value-has-a-type","errorCode":null,"errorMessage":"preset argument '{argument_name}' value has a type error: {type_error}","messagePattern":"preset argument '(.+?)' value has a type error: (.+?)","errorType":"validation","errorClass":"ModelPermissionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/model_permissions/error.rs","lineNumber":35,"sourceCode":"pub struct NamedModelPermissionError {\n    pub model_name: Qualified<ModelName>,\n    pub role: Option<Spanned<Role>>,\n    pub error: ModelPermissionError,\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum ModelPermissionError {\n    #[error(\"preset argument '{argument_name}' is defined more than once\")]\n    DuplicateModelArgumentPreset {\n        argument_name: Spanned<ArgumentName>,\n    },\n\n    #[error(\"model source is required for model '{model_name:}' to resolve predicate\")]\n    ModelSourceRequiredForPredicate {\n        model_name: Spanned<Qualified<ModelName>>,\n    },\n\n    #[error(\"preset argument '{argument_name}' value has a type error: {type_error}\")]\n    ModelArgumentValuePresetTypeError {\n        argument_name: Spanned<ArgumentName>,\n        value_path: JSONPath,\n        type_error: typecheck::TypecheckError,\n    },\n\n    #[error(\n        \"a preset argument '{argument_name}' has been set for the model '{model_name}' but no such argument exists for this model\"\n    )]\n    ModelArgumentPresetArgumentNotFound {\n        model_name: Spanned<Qualified<ModelName>>,\n        argument_name: Spanned<ArgumentName>,\n    },\n\n    #[error(\"in select filter permissions: {error}\")]\n    SelectFilterPermissionTypePredicateError { error: TypePredicateError },\n\n    #[error(\"unknown type {custom_type_name}\")]","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/model_permissions/error.rs#L17-L53","documentation":"ModelArgumentValuePresetTypeError: the value assigned to an argument preset in a model permission does not typecheck against the declared type of that argument. The inner typecheck::TypecheckError describes the mismatch, and a JSONPath points at the offending part of the preset value.","triggerScenarios":"Setting an argument preset value whose JSON shape/type differs from the argument's declared type — e.g. a string for an Int argument, an object for a scalar, wrong UUID/date format, or a session variable placeholder resolving to an incompatible type.","commonSituations":"Using X-Hasura-* session variables with the wrong expected type, hand-writing preset values in YAML (quotes turning numbers into strings), schema type changes after presets were written.","solutions":["Check the inner {type_error} and value_path to see which part of the preset value mismatches","Fix the preset value to match the argument's declared type (correct YAML type, quoting, session variable expression format)","If the argument's type changed, update the preset value to conform to the new type"],"exampleFix":"# before (argument typed as Int)\nargumentPresets:\n  - argument: limit\n    value: \"10\"   # string\n\n# after\nargumentPresets:\n  - argument: limit\n    value: 10","handlingStrategy":"validation","validationCode":"# Before build, typecheck preset values against declared argument types\nfor preset in presets:\n    declared = model_arguments[preset['argument']]  # e.g. 'Int'\n    ok = check_value_against_type(preset['value'], declared)\n    assert ok, f\"preset {preset['argument']} value {preset['value']!r} is not {declared}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match YAML scalar types to argument types (don't quote numbers/booleans)","When argument types change, grep permissions for presets referencing them"],"tags":["hasura","ddn","permissions","preset","typecheck"],"backgroundTag":"preset-value-type-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}