{"record":{"id":"36a334ea2a34d130","repo":"dgraph-io/dgraph","slug":"argument-s-for-given-s-s-must-be-of-the-for","errorCode":null,"errorMessage":"argument `%s` for given %s `%s` must be of the form `[{param1: $var1, param2: $var2, ...}]` for BATCH mode in remote %s.","messagePattern":"argument `(.+?)` for given (.+?) `(.+?)` must be of the form `\\[(.+?)\\]` for BATCH mode in remote (.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"graphql/schema/remote.go","lineNumber":316,"sourceCode":"\t\tif len(remoteQryArgMetadata.typMap) != 1 {\n\t\t\treturn errors.Errorf(\"remote %s `%s` accepts %d arguments, It must have only one \"+\n\t\t\t\t\"argument of the form `[{param1: $var1, param2: $var2, ...}]` for BATCH mode.\",\n\t\t\t\toperationType, givenQuery.Name, len(remoteQryArgMetadata.typMap))\n\t\t}\n\t\tfor argName, inputTyp := range remoteQryArgMetadata.typMap {\n\t\t\tif !((inputTyp.Kind == list && inputTyp.OfType != nil && inputTyp.OfType.\n\t\t\t\tKind == inputObject) ||\n\t\t\t\t(inputTyp.Kind == list && inputTyp.OfType != nil && inputTyp.OfType.\n\t\t\t\t\tKind == nonNull && inputTyp.OfType.OfType != nil && inputTyp.OfType.OfType.\n\t\t\t\t\tKind == inputObject) ||\n\t\t\t\t(inputTyp.Kind == nonNull && inputTyp.OfType != nil && inputTyp.OfType.\n\t\t\t\t\tKind == list && inputTyp.OfType.OfType != nil && inputTyp.OfType.OfType.\n\t\t\t\t\tKind == inputObject) ||\n\t\t\t\t(inputTyp.Kind == nonNull && inputTyp.OfType != nil && inputTyp.OfType.\n\t\t\t\t\tKind == list && inputTyp.OfType.OfType != nil && inputTyp.OfType.OfType.\n\t\t\t\t\tKind == nonNull && inputTyp.OfType.OfType.OfType != nil && inputTyp.\n\t\t\t\t\tOfType.OfType.OfType.Kind == inputObject)) {\n\t\t\t\treturn errors.Errorf(\"argument `%s` for given %s `%s` must be of the form `[{param1\"+\n\t\t\t\t\t\": $var1, param2: $var2, ...}]` for BATCH mode in remote %s.\", argName,\n\t\t\t\t\toperationType, givenQuery.Name, operationType)\n\t\t\t}\n\t\t\tinputTypName := inputTyp.NamedType()\n\t\t\ttyp, ok := remoteTypes[inputTypName]\n\t\t\tif !ok {\n\t\t\t\treturn missingRemoteTypeError(inputTypName)\n\t\t\t}\n\t\t\tif typ.Kind != inputObject {\n\t\t\t\treturn errors.Errorf(\"type %s in remote schema is not an INPUT_OBJECT.\", inputTypName)\n\t\t\t}\n\t\t}\n\t}\n\n\tif !metadata.isBatch {\n\t\t// check whether args of given query/mutation match the args of remote query/mutation\n\t\terr = matchArgSignature(&argMatchingMetadata{\n\t\t\tgivenArgVals:  givenQryArgVals,","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/graphql/schema/remote.go#L298-L334","documentation":"In BATCH mode the remote operation's single argument must be shaped as a list of an input object, allowing non-null wrappers ([X], [X!], [X!]!). If the argument's kind nesting doesn't match any accepted pattern, this error names the offending argument and the required form.","triggerScenarios":"validateRemoteGraphql's BATCH-mode kind check fails for an argument: e.g. the argument is a plain object (not a list), a list of scalars/enums/objects, or nested differently than list-of-input-object (graphql/schema/remote.go:316).","commonSituations":"Remote bulk endpoint takes `ids: [ID!]` (list of scalar, not input object) or a single `filter: UserFilter` object; developer assumed any list argument works for batching.","solutions":["Change the remote operation's argument to a list of an INPUT_OBJECT, e.g. `inputs: [UserInput!]!`, keeping the object's fields as the per-item parameters.","Ensure the argument's referenced type has kind INPUT_OBJECT in the remote schema (see errorIndex 396).","Use SINGLE mode if the remote cannot expose a list-of-input-object argument."],"exampleFix":"// before (remote)\ntype Query { users(ids: [ID!]): [User] }\n// after\ntype Query { users(inputs: [UserInput!]!): [User] }\ninput UserInput { id: ID! }","handlingStrategy":"validation","validationCode":"function isListOfInputObject(arg) {\n  let t = arg.type\n  const nn = t.kind === 'NON_NULL'; if (nn) t = t.ofType\n  if (t.kind !== 'LIST') return false\n  let inner = t.ofType\n  if (inner.kind === 'NON_NULL') inner = inner.ofType\n  return inner.kind === 'INPUT_OBJECT'\n}","typeGuard":"function isListOfInputObject(arg) { let t = arg.type; if (t.kind==='NON_NULL') t=t.ofType; if (t.kind!=='LIST') return false; let i=t.ofType; if (i.kind==='NON_NULL') i=i.ofType; return i.kind==='INPUT_OBJECT' }","tryCatchPattern":null,"preventionTips":["Validate remote arg kind nesting ([X], [X!], [X!]!) before enabling BATCH","Avoid list-of-scalar bulk args (ids: [ID!]) for BATCH-mode endpoints","Encode the accepted shapes in a shared contract test"],"tags":["graphql","batch","input-object","argument-shape"],"backgroundTag":"batch-argument-signature-mismatch","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}