{"record":{"id":"82d028603fa92e13","repo":"weaviate/weaviate","slug":"no-path-found-in-clause-v","errorCode":null,"errorMessage":"no path found in clause: %v","messagePattern":"no path found in clause: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/handlers/graphql/local/common_filters/authz.go","lineNumber":44,"sourceCode":"\t\treturn nil\n\t}\n\tif err := authorizer.Authorize(ctx, principal, authorization.READ, authorization.CollectionsData(path.Class.String())...); err != nil {\n\t\treturn err\n\t}\n\tif path.Child != nil {\n\t\treturn authorizePath(ctx, authorizer, path.Child, principal)\n\t}\n\treturn nil\n}\n\nfunc AuthorizeFilters(ctx context.Context, authorizer authorization.Authorizer, clause *filters.Clause, principal *models.Principal) error {\n\tif clause == nil {\n\t\treturn nil\n\t}\n\tif len(clause.Operands) == 0 {\n\t\tpath := clause.On\n\t\tif path == nil {\n\t\t\treturn fmt.Errorf(\"no path found in clause: %v\", clause)\n\t\t}\n\t\treturn authorizePath(ctx, authorizer, path, principal)\n\t} else {\n\t\tfor _, operand := range clause.Operands {\n\t\t\tif err := AuthorizeFilters(ctx, authorizer, &operand, principal); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc AuthorizeProperty(ctx context.Context, authorizer authorization.Authorizer, property *search.SelectProperty, principal *models.Principal) error {\n\tif property == nil {\n\t\treturn nil\n\t}\n\tfor _, ref := range property.Refs {\n\t\tif err := authorizer.Authorize(ctx, principal, authorization.READ, authorization.CollectionsData(ref.ClassName)...); err != nil {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/handlers/graphql/local/common_filters/authz.go#L26-L62","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nwhere: {} // empty clause -> 'no path found in clause'\n// after\nwhere: { path: [\"name\"], operator: Equal, valueText: \"foo\" }","handlingStrategy":"validation","validationCode":"if clause && !clause.operands?.length && !clause.on?.length) throw new Error('empty filter clause: set path or operands before querying');","typeGuard":"function hasFilterPath(clause) { return Array.isArray(clause?.on) && clause.on.length > 0 || Array.isArray(clause?.operands) && clause.operands.length > 0; }","tryCatchPattern":null,"preventionTips":["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."],"tags":["graphql","authorization","filters"],"backgroundTag":"malformed-filter-clause","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}