dgraph-io/dgraph · error

%s field for the local type %s is not present in the remote

Error message

%s field for the local type %s is not present in the remote type %s

What it means

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.

Source

Thrown at graphql/schema/remote.go:387

					return errors.Errorf(
						"Unable to find local type %s in the remote schema",
						typeName,
					)
				}
				remoteFields := remoteType.Fields
				if remoteFields == nil {
					// Get fields for INPUT_OBJECT
					remoteFields = remoteType.InputFields
				}
				for _, field := range fields {
					var remoteField *gqlField = nil
					for _, rf := range remoteFields {
						if rf.Name == field.Name {
							remoteField = rf
						}
					}
					if remoteField == nil {
						return errors.Errorf(
							"%s field for the local type %s is not present in the remote type %s",
							field.Name, typeName, remoteType.Name,
						)
					}
					if remoteField.Type.String() != field.Type.String() {
						return errors.Errorf(
							"expected type for the field %s is %s but got %s in type %s",
							remoteField.Name,
							remoteField.Type.String(),
							field.Type.String(),
							typeName,
						)
					}
				}
			}
		}
	}
	return nil

View on GitHub (pinned to 759e242be6)

Solutions

  1. Remove the local field or rename it to match the remote type's field name.
  2. If the field was recently removed remotely, restore it or add a @remote-resolved replacement pointing at an existing field.
  3. Add a CI check that diffs local remote-resolved types against fresh remote introspection to catch drift early.

Example fix

// before
type User @remote { id: ID!, email: String! }
// remote User no longer has `email`; after
type User @remote { id: ID!, contactEmail: String! }
Defensive patterns

Strategy: validation

Validate before calling

for (const field of localRemoteType.fields) {
  if (!remoteType.fields.some(f => f.name === field.name)) throw new Error(`field ${field.name} missing on remote type ${remoteType.name}`)
}

Type guard

function fieldExistsOnRemote(remoteType, fieldName) { return remoteType?.fields?.some(f => f.name === fieldName) ?? false }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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