#9838·dgraph

fix(graphql): Undefined type HNSWSearchFilter when mutation updates are disabled on vector-indexed types

Author: matthewmcneelyCreated Sep 22, 2026Updated Sep 22, 2026

Description

GraphQL schema generation fails validation with Undefined type HNSWSearchFilter for indexed embeddings on types configured with @generate(mutation: { update: false }).

Minimal Reproduction

Submit the following schema to /admin/schema/validate:

graphql
type VectorSchemaProbe @generate(mutation: { add: false, update: false, delete: false }) {
  id: ID!
  name: String
  embedding: [Float!] @embedding @search(by: ["hnsw(metric: cosine)"])
}

Validation error:

Undefined type HNSWSearchFilter.

Root Cause

addFilterType treats the HNSW index as an ordinary field filter and emits a reference to HNSWSearchFilter, although that input type does not exist. When generated updates are enabled, cleanupInput removes the invalid reference during traversal of Update...Input and its filter input. With updates disabled, that traversal does not occur, leaving the invalid reference in the generated schema.

Related PR

Addressed in #9837.