{"record":{"id":"835271603be246ee","repo":"hasura/graphql-engine","slug":"cannot-merge-fields-with-different-arguments-on-th","errorCode":null,"errorMessage":"cannot merge fields with different arguments on the same alias: {alias}","messagePattern":"cannot merge fields with different arguments on the same alias: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/crates/graphql/lang-graphql/src/validation/error.rs","lineNumber":67,"sourceCode":"        field_name: ast::Name,\n    },\n    #[error(\n        \"different fields {field1} and {field2} cannot be merged under the same alias: {alias}\"\n    )]\n    FieldsConflictDifferentFields {\n        alias: ast::Alias,\n        field1: ast::Name,\n        field2: ast::Name,\n    },\n    #[error(\n        \"fields of different type {type1} and {type2} cannot be merged under the same alias: {alias}\"\n    )]\n    FieldsConflictDifferingTypes {\n        alias: ast::Alias,\n        type1: ast::Type,\n        type2: ast::Type,\n    },\n    #[error(\"cannot merge fields with different arguments on the same alias: {alias}\")]\n    FieldsConflictDifferingArguments {\n        alias: ast::Alias,\n        location1: Option<spanning::SourcePosition>,\n        location2: Option<spanning::SourcePosition>,\n    },\n    #[error(\"the string {str} in the provided json value is not a valid GraphQL name\")]\n    NotAValidName { str: String },\n    #[error(\"expected a value of type {expected_type} but found a value of type {actual_type}\")]\n    IncorrectFormat {\n        expected_type: &'static str,\n        actual_type: &'static str,\n    },\n    #[error(\"a null value found when expected a value of not nullable type: {expected_type}\")]\n    UnexpectedNull { expected_type: ast::Type },\n    #[error(\"the field {field_name} on type {type_name} is not found\")]\n    InputFieldNotFound {\n        type_name: ast::TypeName,\n        field_name: ast::Name,","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/graphql/lang-graphql/src/validation/error.rs#L49-L85","documentation":"Thrown by the FieldsCanMerge rule when two fields merged under the same response key pass different arguments, e.g. `{ f(field: A), f(field: B) }` or the same aliased field with different argument sets via fragments. Fields that merge into one response entry must either share identical arguments or not take conflicting ones; the error reports the alias and both source positions (Option<spanning::SourcePosition>) so you can jump to both occurrences in the document.","triggerScenarios":"Repeating a field with the same alias but different argument values (e.g. `user(id: 1)` and `user(id: 2)` without distinct aliases); fragments that select the same field with different arguments spread into the same scope; default arguments applied differently to two occurrences.","commonSituations":"Querying the same connection with different filters and forgetting distinct aliases; generated fragments (e.g. pagination or list fragments) reusing a field with varying arguments; copy-pasted selections where arguments were edited in one copy only.","solutions":["Give each variant a distinct alias (`{ first: user(id: 1), second: user(id: 2) }`)","Make the arguments identical across all occurrences if a single merged result is intended","Check fragments spread into the same selection set for duplicated fields with differing arguments"],"exampleFix":"// before\n{ user(id: 1) { name } user(id: 2) { name } }\n// after\n{ u1: user(id: 1) { name } u2: user(id: 2) { name } }","handlingStrategy":"validation","validationCode":"for (key, fields) in group_by_response_key(selection) { for w in fields.windows(2) { assert!(same_args(&w[0].arguments, &w[1].arguments), \"alias {key} used with differing arguments\"); } }","typeGuard":"fn same_args(a: &[(Name, Value)], b: &[(Name, Value)]) -> bool { a == b }","tryCatchPattern":"match validate(doc) { Err(Error::FieldsConflictDifferingArguments { alias, .. }) => give_unique_alias(alias), r => r }","preventionTips":["Always alias repeated fields that differ in arguments","Check fragments combined into one scope for repeated fields with different args","Let a query builder deduplicate selections by (field, args)"],"tags":["graphql","argument-conflict","fields-merge","alias"],"backgroundTag":"graphql-fields-conflict","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}