{"record":{"id":"8acce55e4ba7b32f","repo":"dgraph-io/dgraph","slug":"object-value-supplied-for-argument-s-in-s-s","errorCode":null,"errorMessage":"object value supplied for argument `%s` in %s `%s`, but remote argument doesn't accept INPUT_OBJECT.","messagePattern":"object value supplied for argument `(.+?)` in (.+?) `(.+?)`, but remote argument doesn't accept INPUT_OBJECT\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"graphql/schema/remote.go","lineNumber":451,"sourceCode":"\t\t\t//if rootType.NamedType == \"ID\" {\n\t\t\t//\trootType.NamedType = \"String\"\n\t\t\t//}\n\t\t\texpectedArgType := givenArgTyp.String()\n\t\t\tgotArgType := remoteArgTyp.String()\n\t\t\tif expectedArgType != gotArgType {\n\t\t\t\treturn errors.Errorf(\"found type mismatch for variable `$%s` in %s `%s`, expected\"+\n\t\t\t\t\t\" `%s`, got `%s`.\", givenArgVal.Raw, *md.operationType, *md.givenQryName,\n\t\t\t\t\texpectedArgType, gotArgType)\n\t\t\t}\n\t\t\t// deep check the remote type and verify it with the local schema.\n\t\t\tif err := matchDeepTypes(remoteArgTyp, md.remoteTypes, md.schema); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase ast.ObjectValue:\n\t\t\tif !(remoteArgTyp.Kind == inputObject || (remoteArgTyp.\n\t\t\t\tKind == nonNull && remoteArgTyp.OfType != nil && remoteArgTyp.OfType.\n\t\t\t\tKind == inputObject)) {\n\t\t\t\treturn errors.Errorf(\"object value supplied for argument `%s` in %s `%s`, \"+\n\t\t\t\t\t\"but remote argument doesn't accept INPUT_OBJECT.\", givenArgName,\n\t\t\t\t\t*md.operationType, *md.givenQryName)\n\t\t\t}\n\t\t\tremoteObjTypname := remoteArgTyp.NamedType()\n\t\t\tremoteObjTyp, ok := md.remoteTypes[remoteObjTypname]\n\t\t\tif !ok {\n\t\t\t\treturn missingRemoteTypeError(remoteObjTypname)\n\t\t\t}\n\t\t\tif err := matchArgSignature(&argMatchingMetadata{\n\t\t\t\tgivenArgVals:  getObjChildrenValsAsMap(givenArgVal),\n\t\t\t\tgivenVarTypes: md.givenVarTypes,\n\t\t\t\tremoteArgMd:   getRemoteTypeFieldsMetadata(remoteObjTyp),\n\t\t\t\tremoteTypes:   md.remoteTypes,\n\t\t\t\tgivenQryName:  md.givenQryName,\n\t\t\t\toperationType: md.operationType,\n\t\t\t\tschema:        md.schema,\n\t\t\t}); err != nil {\n\t\t\t\treturn err","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/graphql/schema/remote.go#L433-L469","documentation":"When an argument is supplied as a GraphQL object literal (ast.ObjectValue), matchArgSignature checks that the remote argument's type is an INPUT_OBJECT (possibly wrapped in NonNull). If the remote argument is a scalar, list, or enum instead, this error is thrown. The library only forwards structured object arguments to remotes that declare a matching input object type.","triggerScenarios":"validateRemoteGraphql -> matchArgSignature on a query like `query { f(filter: {a: 1}) }` where the remote argument `filter` is declared as a scalar/enum/list rather than an INPUT_OBJECT type (or NonNull-wrapped INPUT_OBJECT).","commonSituations":"Local schema treats a field as an object while the remote defines it as scalar (e.g. remote changed an input from an object to a scalar JSON/enum); wrong remote field targeted; stale remote SDL cached locally.","solutions":["Change the query to supply a value whose shape matches the remote argument's declared kind (scalar literal, enum, or list).","Update the remote schema/SDL so the argument is (re)declared as an INPUT_OBJECT if object input is intended.","Verify you are pointing at the intended remote field/service — the kind mismatch often means the wrong operation is being composed.","Refresh any cached/introspected remote schema after upstream changes."],"exampleFix":"// before (remote arg: filter: String)\nquery { search(filter: {q: \"x\"}) }\n// after\nquery { search(filter: \"x\") }","handlingStrategy":"validation","validationCode":"// Ensure object literals are only used for INPUT_OBJECT args\nif valueKind == \"ObjectValue\" && !(argType.Kind == \"INPUT_OBJECT\" || wraps(argType, \"INPUT_OBJECT\")) {\n    return fmt.Errorf(\"arg %s is not INPUT_OBJECT on remote\", argName)\n}","typeGuard":"func isInputObject(t *ast.Type) bool {\n    return t.Kind == inputObject || (t.Kind == nonNull && t.OfType != nil && t.OfType.Kind == inputObject)\n}","tryCatchPattern":"if err := validateRemoteGraphql(...); err != nil {\n    if strings.Contains(err.Error(), \"doesn't accept INPUT_OBJECT\") {\n        return fmt.Errorf(\"reshape argument %w\", err)\n    }\n    return err\n}","preventionTips":["Introspect remote argument kinds before writing object literals","Refresh cached remote SDL after upstream deploys","Don't assume local shapes match remote shapes"],"tags":["graphql","arguments","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"}