weaviate/weaviate · error
no path found in clause: %v
Error message
no path found in clause: %v
What it means
AuthorizeFilters walks a GraphQL filter clause tree and authorizes each path (class/property chain) against the authorizer. If a clause has no operands but its On field (the path) is nil, there is nothing to authorize and the clause is malformed, so it returns this error. The %v prints the offending clause for debugging.
Source
Thrown at adapters/handlers/graphql/local/common_filters/authz.go:44
return nil
}
if err := authorizer.Authorize(ctx, principal, authorization.READ, authorization.CollectionsData(path.Class.String())...); err != nil {
return err
}
if path.Child != nil {
return authorizePath(ctx, authorizer, path.Child, principal)
}
return nil
}
func AuthorizeFilters(ctx context.Context, authorizer authorization.Authorizer, clause *filters.Clause, principal *models.Principal) error {
if clause == nil {
return nil
}
if len(clause.Operands) == 0 {
path := clause.On
if path == nil {
return fmt.Errorf("no path found in clause: %v", clause)
}
return authorizePath(ctx, authorizer, path, principal)
} else {
for _, operand := range clause.Operands {
if err := AuthorizeFilters(ctx, authorizer, &operand, principal); err != nil {
return err
}
}
}
return nil
}
func AuthorizeProperty(ctx context.Context, authorizer authorization.Authorizer, property *search.SelectProperty, principal *models.Principal) error {
if property == nil {
return nil
}
for _, ref := range property.Refs {
if err := authorizer.Authorize(ctx, principal, authorization.READ, authorization.CollectionsData(ref.ClassName)...); err != nil {View on GitHub (pinned to 75aa4b6d11)
Solutions
- Inspect the printed clause in the error to find which filter argument was serialized empty.
- Remove the empty filter or populate its path (On) and value before sending the query.
- In client code, skip appending filter clauses that have no path and no operands.
- If you construct filters via an SDK, use its typed filter builder so empty clauses cannot be emitted.
Example fix
// before
where: {} // empty clause -> 'no path found in clause'
// after
where: { path: ["name"], operator: Equal, valueText: "foo" } Defensive patterns
Strategy: validation
Validate before calling
if clause && !clause.operands?.length && !clause.on?.length) throw new Error('empty filter clause: set path or operands before querying'); Type guard
function hasFilterPath(clause) { return Array.isArray(clause?.on) && clause.on.length > 0 || Array.isArray(clause?.operands) && clause.operands.length > 0; } Prevention
- Only add filter clauses when you actually have a path and value.
- Use the SDK's typed filter builder instead of hand-built objects.
- Log serialized filters in dev to catch empty clauses early.
When it happens
Trigger: A Get/Aggregate query resolves a filter clause (Where/Near filters) whose Operands slice is empty and whose On pointer is nil — i.e. a structurally empty filter clause reaches authorization. This typically happens when a filter argument is deserialized as an empty clause object instead of being omitted.
Common situations: Programmatically constructed GraphQL queries (clients, SDK wrappers, batch generators) that emit a where filter with no value/operands; GraphQL-layer refactors that pass a nil path; passing an empty filter object from a REST-to-GraphQL bridge.
Related errors
- empty where
- could not extract filters: %w
- failed to extract filters: %w
- operands[%v]: %w
- could not extract filters: %w
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/82d028603fa92e13.
Report an issue: GitHub.