{"record":{"id":"372deec2cd963986","repo":"dgraph-io/dgraph","slug":"argument-s-in-s-s-of-list-kind-has-non-obje","errorCode":null,"errorMessage":"argument `%s` in %s `%s` of List kind has non-object elements in remote %s, Lists can have only INPUT_OBJECT as element.","messagePattern":"argument `(.+?)` in (.+?) `(.+?)` of List kind has non-object elements in remote (.+?), Lists can have only INPUT_OBJECT as element\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"graphql/schema/remote.go","lineNumber":485,"sourceCode":"\t\t\t\tschema:        md.schema,\n\t\t\t}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase ast.ListValue:\n\t\t\tif !((remoteArgTyp.Kind == list && remoteArgTyp.OfType != nil) || (remoteArgTyp.\n\t\t\t\tKind == nonNull && remoteArgTyp.OfType != nil && remoteArgTyp.OfType.\n\t\t\t\tKind == list && remoteArgTyp.OfType.OfType != nil)) {\n\t\t\t\treturn errors.Errorf(\"LIST value supplied for argument `%s` in %s `%s`, \"+\n\t\t\t\t\t\"but remote argument doesn't accept LIST.\", givenArgName, *md.operationType,\n\t\t\t\t\t*md.givenQryName)\n\t\t\t}\n\t\t\tremoteListElemTypname := remoteArgTyp.NamedType()\n\t\t\tremoteObjTyp, ok := md.remoteTypes[remoteListElemTypname]\n\t\t\tif !ok {\n\t\t\t\treturn missingRemoteTypeError(remoteListElemTypname)\n\t\t\t}\n\t\t\tif remoteObjTyp.Kind != inputObject {\n\t\t\t\treturn errors.Errorf(\"argument `%s` in %s `%s` of List kind has non-object\"+\n\t\t\t\t\t\" elements in remote %s, Lists can have only INPUT_OBJECT as element.\",\n\t\t\t\t\tgivenArgName, *md.operationType, *md.givenQryName, *md.operationType)\n\t\t\t}\n\t\t\tremoteObjChildMap := getRemoteTypeFieldsMetadata(remoteObjTyp)\n\t\t\tfor _, givenElem := range givenArgVal.Children {\n\t\t\t\tif givenElem.Value.Kind != ast.ObjectValue {\n\t\t\t\t\treturn errors.Errorf(\"argument `%s` in %s `%s` of List kind has non-object\"+\n\t\t\t\t\t\t\" elements, Lists can have only objects as element.\", givenArgName,\n\t\t\t\t\t\t*md.operationType, *md.givenQryName)\n\t\t\t\t}\n\t\t\t\tif err := matchArgSignature(&argMatchingMetadata{\n\t\t\t\t\tgivenArgVals:  getObjChildrenValsAsMap(givenElem.Value),\n\t\t\t\t\tgivenVarTypes: md.givenVarTypes,\n\t\t\t\t\tremoteArgMd:   remoteObjChildMap,\n\t\t\t\t\tremoteTypes:   md.remoteTypes,\n\t\t\t\t\tgivenQryName:  md.givenQryName,\n\t\t\t\t\toperationType: md.operationType,\n\t\t\t\t\tschema:        md.schema,","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/graphql/schema/remote.go#L467-L503","documentation":"When a list argument is accepted (remote arg is a LIST), matchArgSignature additionally requires that the remote list's element type is an INPUT_OBJECT. If the remote element type is a scalar, enum, or other kind, this error is thrown. The library's argument matcher only supports lists of input objects for deep element validation.","triggerScenarios":"validateRemoteGraphql -> matchArgSignature on a query supplying a list value (e.g. `f(items: [{a: 1}])`) where the remote argument is `[Int]`, `[String]`, or an enum list — i.e. the element kind is not INPUT_OBJECT.","commonSituations":"Remote changed a list of input objects into a list of scalars/IDs; client models the argument as object elements while remote expects primitive elements; composition library limitation hit for scalar lists.","solutions":["Supply scalar/enum elements matching the remote list element type (e.g. `ids: [\"1\",\"2\"]`) if the remote is a scalar list.","If object elements are intended, change the remote schema so the list element is an INPUT_OBJECT type.","If the remote legitimately uses scalar lists and this validator is too strict, bypass/skip argument deep-matching for that field via configuration if available, or file/patch the validator.","Confirm the correct remote operation is being composed; wrong target can surface element-kind mismatches."],"exampleFix":"// before (remote arg: ids: [ID!])\nquery { users(ids: [{id: \"1\"}]) }\n// after\nquery { users(ids: [\"1\"]) }","handlingStrategy":"validation","validationCode":"// For list args, verify the element type is INPUT_OBJECT\nelem := listElementType(remoteArgType)\nif elem == nil || elem.Kind != \"INPUT_OBJECT\" {\n    return fmt.Errorf(\"remote list element for %s is not INPUT_OBJECT\", argName)\n}","typeGuard":"func isInputObjectList(t *ast.Type) bool {\n    elem := t.NamedType()\n    return elem != \"\" && remoteTypes[elem] != nil && remoteTypes[elem].Kind == inputObject\n}","tryCatchPattern":"if err := validateRemoteGraphql(...); err != nil {\n    if strings.Contains(err.Error(), \"non-object elements in remote\") {\n        return fmt.Errorf(\"use scalar elements or fix remote SDL: %w\", err)\n    }\n    return err\n}","preventionTips":["Confirm list element kinds via introspection before composing","If remotes use scalar lists, plan for validator limitations (skip or extend matcher)","Keep remote SDL current"],"tags":["graphql","list","input-object"],"backgroundTag":"graphql-argument-kind-mismatch","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}