{"record":{"id":"762724418e0a87c7","repo":"hasura/graphql-engine","slug":"a-preset-argument-argument-name-has-been-set-f","errorCode":null,"errorMessage":"a preset argument '{argument_name}' has been set for the model '{model_name}' but no such argument exists for this model","messagePattern":"a preset argument '(.+?)' has been set for the model '(.+?)' but no such argument exists for this model","errorType":"validation","errorClass":"ModelPermissionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/model_permissions/error.rs","lineNumber":42,"sourceCode":"pub 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}\")]\n    UnknownType {\n        custom_type_name: Qualified<CustomTypeName>,\n    },\n\n    #[error(\"model source is required to resolve relational permissions\")]\n    ModelSourceRequiredForRelationalPermissions,\n    #[error(\"unknown collection {collection} in data connector {data_connector}\")]","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/model_permissions/error.rs#L24-L60","documentation":"ModelArgumentPresetArgumentNotFound: a permission for a model sets a preset for an argument name that the model does not declare. Model argument presets can only target arguments that exist on the model's command/query definition.","triggerScenarios":"Adding `argumentPresets` entries referencing an argument name not present in the model's arguments (typo, renamed argument, or argument removed from the underlying command).","commonSituations":"Renaming or removing model arguments without updating permissions; typos in preset argument names; permissions written against an older version of the model.","solutions":["Fix the preset argument name to match an argument declared on the model (check spelling/case)","If the argument was removed from the model, delete the preset entry","If the argument should exist, add it to the model's command definition"],"exampleFix":"# before\n# model declares argument: userId\nargumentPresets:\n  - argument: user_id   # typo\n    value: X-Hasura-User-Id\n\n# after\nargumentPresets:\n  - argument: userId\n    value: X-Hasura-User-Id","handlingStrategy":"validation","validationCode":"model_arg_names = set(model['definition'].get('arguments', {}) or {})\nfor p in presets:\n    assert p['argument'] in model_arg_names, \\\n        f\"preset references unknown argument {p['argument']}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep presets and model argument declarations in the same review/PR","Rename arguments via tooling that updates references, not by hand"],"tags":["hasura","ddn","permissions","preset","unknown-argument"],"backgroundTag":"unknown-argument-preset","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}