dgraph-io/dgraph · error

LIST value supplied for argument `%s` in %s `%s`, but remote

Error message

LIST value supplied for argument `%s` in %s `%s`, but remote argument doesn't accept LIST.

What it means

When an argument is supplied as a GraphQL list literal (ast.ListValue), matchArgSignature verifies the remote argument type is a LIST (with a defined element type), either bare or NonNull-wrapped. If the remote argument does not accept a list, this error is thrown so an incompatible list value is never forwarded upstream.

Source

Thrown at graphql/schema/remote.go:475

			if !ok {
				return missingRemoteTypeError(remoteObjTypname)
			}
			if err := matchArgSignature(&argMatchingMetadata{
				givenArgVals:  getObjChildrenValsAsMap(givenArgVal),
				givenVarTypes: md.givenVarTypes,
				remoteArgMd:   getRemoteTypeFieldsMetadata(remoteObjTyp),
				remoteTypes:   md.remoteTypes,
				givenQryName:  md.givenQryName,
				operationType: md.operationType,
				schema:        md.schema,
			}); err != nil {
				return err
			}
		case ast.ListValue:
			if !((remoteArgTyp.Kind == list && remoteArgTyp.OfType != nil) || (remoteArgTyp.
				Kind == nonNull && remoteArgTyp.OfType != nil && remoteArgTyp.OfType.
				Kind == list && remoteArgTyp.OfType.OfType != nil)) {
				return errors.Errorf("LIST value supplied for argument `%s` in %s `%s`, "+
					"but remote argument doesn't accept LIST.", givenArgName, *md.operationType,
					*md.givenQryName)
			}
			remoteListElemTypname := remoteArgTyp.NamedType()
			remoteObjTyp, ok := md.remoteTypes[remoteListElemTypname]
			if !ok {
				return missingRemoteTypeError(remoteListElemTypname)
			}
			if remoteObjTyp.Kind != inputObject {
				return errors.Errorf("argument `%s` in %s `%s` of List kind has non-object"+
					" elements in remote %s, Lists can have only INPUT_OBJECT as element.",
					givenArgName, *md.operationType, *md.givenQryName, *md.operationType)
			}
			remoteObjChildMap := getRemoteTypeFieldsMetadata(remoteObjTyp)
			for _, givenElem := range givenArgVal.Children {
				if givenElem.Value.Kind != ast.ObjectValue {
					return errors.Errorf("argument `%s` in %s `%s` of List kind has non-object"+
						" elements, Lists can have only objects as element.", givenArgName,

View on GitHub (pinned to 759e242be6)

Solutions

  1. Send a single (non-list) value matching the remote argument type instead of a list.
  2. Update the remote SDL so the argument is declared as a list (e.g. `[Int!]`) if list input is intended.
  3. Check that you are validating against the correct remote operation; kind mismatches often indicate a name collision.
  4. Re-introspect and refresh the stored remote schema.

Example fix

// before (remote arg: id: ID!)
query { user(ids: ["1"]) }
// after
query { user(ids: "1") }
Defensive patterns

Strategy: validation

Validate before calling

// Ensure list literals target LIST args
if valueKind == "ListValue" && !isListAccepting(argType) {
    return fmt.Errorf("arg %s is not a LIST on remote", argName)
}

func isListAccepting(t *ast.Type) bool {
    return (t.Kind == list && t.OfType != nil) ||
        (t.Kind == nonNull && t.OfType != nil && t.OfType.Kind == list && t.OfType.OfType != nil)
}

Type guard

func isListArg(t *ast.Type) bool { return isListAccepting(t) }

Try / catch

if err := validateRemoteGraphql(...); err != nil {
    if strings.Contains(err.Error(), "doesn't accept LIST") {
        return fmt.Errorf("send single value or fix remote SDL: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: validateRemoteGraphql -> matchArgSignature on a query like `query { f(ids: ["a","b"]) }` where the remote argument `ids` is a scalar, INPUT_OBJECT, or enum rather than a List (or the List has no element type / NonNull-wrapped form lacks a nested type).

Common situations: Client sends an array where the remote now expects a single value (or vice versa) after an API change; wrong field/remote targeted; stale cached remote schema.

Related errors


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