dgraph-io/dgraph · error

argument `%s` for given %s `%s` must be of the form `[{param

Error message

argument `%s` for given %s `%s` must be of the form `[{param1: $var1, param2: $var2, ...}]` for BATCH mode in remote %s.

What it means

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.

Source

Thrown at graphql/schema/remote.go:316

		if len(remoteQryArgMetadata.typMap) != 1 {
			return errors.Errorf("remote %s `%s` accepts %d arguments, It must have only one "+
				"argument of the form `[{param1: $var1, param2: $var2, ...}]` for BATCH mode.",
				operationType, givenQuery.Name, len(remoteQryArgMetadata.typMap))
		}
		for argName, inputTyp := range remoteQryArgMetadata.typMap {
			if !((inputTyp.Kind == list && inputTyp.OfType != nil && inputTyp.OfType.
				Kind == inputObject) ||
				(inputTyp.Kind == list && inputTyp.OfType != nil && inputTyp.OfType.
					Kind == nonNull && inputTyp.OfType.OfType != nil && inputTyp.OfType.OfType.
					Kind == inputObject) ||
				(inputTyp.Kind == nonNull && inputTyp.OfType != nil && inputTyp.OfType.
					Kind == list && inputTyp.OfType.OfType != nil && inputTyp.OfType.OfType.
					Kind == inputObject) ||
				(inputTyp.Kind == nonNull && inputTyp.OfType != nil && inputTyp.OfType.
					Kind == list && inputTyp.OfType.OfType != nil && inputTyp.OfType.OfType.
					Kind == nonNull && inputTyp.OfType.OfType.OfType != nil && inputTyp.
					OfType.OfType.OfType.Kind == inputObject)) {
				return errors.Errorf("argument `%s` for given %s `%s` must be of the form `[{param1"+
					": $var1, param2: $var2, ...}]` for BATCH mode in remote %s.", argName,
					operationType, givenQuery.Name, operationType)
			}
			inputTypName := inputTyp.NamedType()
			typ, ok := remoteTypes[inputTypName]
			if !ok {
				return missingRemoteTypeError(inputTypName)
			}
			if typ.Kind != inputObject {
				return errors.Errorf("type %s in remote schema is not an INPUT_OBJECT.", inputTypName)
			}
		}
	}

	if !metadata.isBatch {
		// check whether args of given query/mutation match the args of remote query/mutation
		err = matchArgSignature(&argMatchingMetadata{
			givenArgVals:  givenQryArgVals,

View on GitHub (pinned to 759e242be6)

Solutions

  1. 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.
  2. Ensure the argument's referenced type has kind INPUT_OBJECT in the remote schema (see errorIndex 396).
  3. Use SINGLE mode if the remote cannot expose a list-of-input-object argument.

Example fix

// before (remote)
type Query { users(ids: [ID!]): [User] }
// after
type Query { users(inputs: [UserInput!]!): [User] }
input UserInput { id: ID! }
Defensive patterns

Strategy: validation

Validate before calling

function isListOfInputObject(arg) {
  let t = arg.type
  const nn = t.kind === 'NON_NULL'; if (nn) t = t.ofType
  if (t.kind !== 'LIST') return false
  let inner = t.ofType
  if (inner.kind === 'NON_NULL') inner = inner.ofType
  return inner.kind === 'INPUT_OBJECT'
}

Type guard

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' }

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of dgraph-io/dgraph@759e242be6 (2026-09-01). Data as JSON: /api/errors/36a334ea2a34d130. Report an issue: GitHub.