{"record":{"id":"06d71245adee821f","repo":"hasura/graphql-engine","slug":"required-argument-argument-name-not-found-on-fie","errorCode":null,"errorMessage":"required argument {argument_name} not found on field {field_name} of type {type_name}","messagePattern":"required argument (.+?) not found on field (.+?) of type (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/crates/graphql/lang-graphql/src/validation/error.rs","lineNumber":178,"sourceCode":"        type_name: ast::TypeName,\n        field_name: ast::Name,\n        argument_names: Vec<ast::Name>,\n    },\n    #[error(\"argument {argument_name} on field {field_name} of type {type_name} not found\")]\n    ArgumentNotFound {\n        type_name: ast::TypeName,\n        field_name: ast::Name,\n        argument_name: ast::Name,\n    },\n    #[error(\n        \"argument {argument_name} on field {field_name} of type {type_name} is defined more than once\"\n    )]\n    DuplicateArguments {\n        type_name: ast::TypeName,\n        field_name: ast::Name,\n        argument_name: ast::Name,\n    },\n    #[error(\n        \"required argument {argument_name} not found on field {field_name} of type {type_name}\"\n    )]\n    RequiredArgumentNotFound {\n        type_name: ast::TypeName,\n        field_name: ast::Name,\n        argument_name: ast::Name,\n    },\n    #[error(\"no fields are selected\")]\n    FieldSelectionSetIsEmpty,\n}\n","sourceCodeStart":160,"sourceCodeEnd":189,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/graphql/lang-graphql/src/validation/error.rs#L160-L189","documentation":"Validation error stating that a field was selected without supplying an argument the schema marks as required (non-null, no default). The validator checks required arguments during normalization and reports the missing one by name.","triggerScenarios":"Selecting a field that declares a required (non-null, non-default) argument but omitting it: `query { requiredField }` where requiredField(arg: String!) is defined.","commonSituations":"Schema evolution adds a new required argument and old clients break, hand-written queries missing inputs, codegen clients out of date.","solutions":["Add the required argument with a value of the correct type to the field","If you own the schema, give the argument a default value or make it nullable for backward compatibility","Update/regenerate client code after the schema added the required argument"],"exampleFix":"# before\nquery { nearbyPosts { id } } # radius: Float! required\n# after\nquery { nearbyPosts(radius: 5.0) { id } }","handlingStrategy":"validation","validationCode":"// Check required args before sending\nlet missing: Vec<_> = required_args(field_def).filter(|a| !provided.contains(a)).collect();\nif !missing.is_empty() { return Err(format!(\"missing args: {missing:?}\")); }","typeGuard":null,"tryCatchPattern":"// Catch Error::RequiredArgumentNotFound { argument_name, .. } and prompt for the missing input","preventionTips":["Prefer schema changes with defaults over new required args","Validate with the schema before executing"],"tags":["graphql","validation","required-argument","missing-argument"],"backgroundTag":"graphql-missing-required-argument","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}