{"record":{"id":"86c73e7c9abcda8b","repo":"dgraph-io/dgraph","slug":"type-s-in-remote-schema-is-not-an-input-object","errorCode":null,"errorMessage":"type %s in remote schema is not an INPUT_OBJECT.","messagePattern":"type (.+?) in remote schema is not an INPUT_OBJECT\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"graphql/schema/remote.go","lineNumber":326,"sourceCode":"\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,\n\t\t\tgivenVarTypes: givenQryVarTypes,\n\t\t\tremoteArgMd:   remoteQryArgMetadata,\n\t\t\tremoteTypes:   remoteTypes,\n\t\t\tgivenQryName:  &givenQuery.Name,\n\t\t\toperationType: &operationType,\n\t\t\tschema:        metadata.schema,\n\t\t})\n\t}\n\n\treturn err","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/graphql/schema/remote.go#L308-L344","documentation":"When validating the BATCH-mode argument, the argument's named type is looked up in the remote introspected types and its kind is checked. If the type exists but is not of kind INPUT_OBJECT (e.g. it is an OBJECT, SCALAR, or ENUM), this error states that the type is not an INPUT_OBJECT.","triggerScenarios":"validateRemoteGraphql finds typ in remoteTypes for the batch argument's NamedType but typ.Kind != inputObject (graphql/schema/remote.go:326) — e.g. argument declared as a list of an output object type.","commonSituations":"Remote API reuses an output type as the batch argument type; the remote schema changed an input type into a regular type; typo causes resolution to a same-named non-input type.","solutions":["Declare the argument type in the remote schema with `input` keyword so its kind is INPUT_OBJECT.","If a regular type with the same name exists, rename one of them so the argument resolves to the input type.","Re-introspect the remote schema to confirm the kind after any upstream refactor."],"exampleFix":"// before (remote)\ntype UserInput { id: ID!, name: String! }\n// after\ninput UserInput { id: ID!, name: String! }","handlingStrategy":"type-guard","validationCode":"const t = typesByName[arg.type.nameFetch()]\nif (t && t.kind !== 'INPUT_OBJECT') throw new Error(`type ${t.name} must be declared with the 'input' keyword`)","typeGuard":"function isInputObject(type) { return type?.kind === 'INPUT_OBJECT' }","tryCatchPattern":null,"preventionTips":["Always declare batch argument types with `input`, never `type`","Avoid name collisions between input and output types","Assert INPUT_OBJECT kind in remote schema tests"],"tags":["graphql","input-object","kind-mismatch","remote-schema"],"backgroundTag":"schema-type-mismatch","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}