{"record":{"id":"2f7b44bd18c65e11","repo":"dgraph-io/dgraph","slug":"s-field-for-the-local-type-s-is-not-present-in-t","errorCode":null,"errorMessage":"%s field for the local type %s is not present in the remote type %s","messagePattern":"(.+?) field for the local type (.+?) is not present in the remote type (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"graphql/schema/remote.go","lineNumber":387,"sourceCode":"\t\t\t\t\treturn errors.Errorf(\n\t\t\t\t\t\t\"Unable to find local type %s in the remote schema\",\n\t\t\t\t\t\ttypeName,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tremoteFields := remoteType.Fields\n\t\t\t\tif remoteFields == nil {\n\t\t\t\t\t// Get fields for INPUT_OBJECT\n\t\t\t\t\tremoteFields = remoteType.InputFields\n\t\t\t\t}\n\t\t\t\tfor _, field := range fields {\n\t\t\t\t\tvar remoteField *gqlField = nil\n\t\t\t\t\tfor _, rf := range remoteFields {\n\t\t\t\t\t\tif rf.Name == field.Name {\n\t\t\t\t\t\t\tremoteField = rf\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif remoteField == nil {\n\t\t\t\t\t\treturn errors.Errorf(\n\t\t\t\t\t\t\t\"%s field for the local type %s is not present in the remote type %s\",\n\t\t\t\t\t\t\tfield.Name, typeName, remoteType.Name,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif remoteField.Type.String() != field.Type.String() {\n\t\t\t\t\t\treturn errors.Errorf(\n\t\t\t\t\t\t\t\"expected type for the field %s is %s but got %s in type %s\",\n\t\t\t\t\t\t\tremoteField.Name,\n\t\t\t\t\t\t\tremoteField.Type.String(),\n\t\t\t\t\t\t\tfield.Type.String(),\n\t\t\t\t\t\t\ttypeName,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil","sourceCodeStart":369,"sourceCodeEnd":405,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/graphql/schema/remote.go#L369-L405","documentation":"For each field of a local remote-resolved type, matchRemoteTypes searches the corresponding remote type's fields for a same-named field. If no remote field matches, this error reports which field of which local type is missing on which remote type.","triggerScenarios":"In matchRemoteTypes, the loop over remoteFields finds no rf.Name == field.Name, leaving remoteField nil (graphql/schema/remote.go:387) — a local field has no counterpart on the remote type.","commonSituations":"Remote API removed or renamed a field the local schema still exposes; local schema added a convenience field assuming remote support; version drift between local SDL and remote schema.","solutions":["Remove the local field or rename it to match the remote type's field name.","If the field was recently removed remotely, restore it or add a @remote-resolved replacement pointing at an existing field.","Add a CI check that diffs local remote-resolved types against fresh remote introspection to catch drift early."],"exampleFix":"// before\ntype User @remote { id: ID!, email: String! }\n// remote User no longer has `email`; after\ntype User @remote { id: ID!, contactEmail: String! }","handlingStrategy":"validation","validationCode":"for (const field of localRemoteType.fields) {\n  if (!remoteType.fields.some(f => f.name === field.name)) throw new Error(`field ${field.name} missing on remote type ${remoteType.name}`)\n}","typeGuard":"function fieldExistsOnRemote(remoteType, fieldName) { return remoteType?.fields?.some(f => f.name === fieldName) ?? false }","tryCatchPattern":null,"preventionTips":["Diff local remote-resolved types against remote introspection in CI on every remote deploy","Remove local fields immediately when the remote field is deprecated","Subscribe to remote API change feeds/changelogs"],"tags":["graphql","remote-schema","missing-field","schema-drift"],"backgroundTag":"field-not-in-remote-schema","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}