{"record":{"id":"67d1ade688fcec8e","repo":"weaviate/weaviate","slug":"expected-source-to-contain-a-usable-resolver-but-67d1ad","errorCode":null,"errorMessage":"expected source to contain a usable Resolver, but was %#v","messagePattern":"expected source to contain a usable Resolver, but was %#v","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/handlers/graphql/local/explore/concepts_resolver.go","lineNumber":56,"sourceCode":"// RequestsLog is a local abstraction on the RequestsLog that needs to be\n// provided to the graphQL API in order to log Local.Fetch queries.\ntype RequestsLog interface {\n\tRegister(requestType string, identifier string)\n}\n\ntype resources struct {\n\tresolver Resolver\n}\n\nfunc newResources(s interface{}) (*resources, error) {\n\tsource, ok := s.(map[string]interface{})\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"expected source to be a map, but was %T\", source)\n\t}\n\n\tresolver, ok := source[\"Resolver\"].(Resolver)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"expected source to contain a usable Resolver, but was %#v\", source)\n\t}\n\n\treturn &resources{\n\t\tresolver: resolver,\n\t}, nil\n}\n\ntype resolver struct {\n\tauthorizer      authorization.Authorizer\n\tmodulesProvider ModulesProvider\n}\n\nfunc newResolver(authorizer authorization.Authorizer, modulesProvider ModulesProvider) *resolver {\n\treturn &resolver{authorizer, modulesProvider}\n}\n\nfunc (r *resolver) resolve(p graphql.ResolveParams) (interface{}, error) {\n\tresult, err := r.resolveExplore(p)","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/handlers/graphql/local/explore/concepts_resolver.go#L38-L74","documentation":"After newResources confirms p.Source is a map, it asserts source[\"Resolver\"] is the explore.Resolver interface type. If the map exists but lacks a usable Resolver entry (nil or wrong type), this error is returned. Like error 851 it guards internal GraphQL wiring, not user input.","triggerScenarios":"The Explore root source map was built without the \"Resolver\" key, or stored a value that is not assignable to explore.Resolver (nil interface, a different resolver type, or a wrapped pointer).","commonSituations":"Custom GraphQL schema assembly in a fork; test harnesses that build the source map by hand; refactors that renamed or re-typed the Resolver field in the source map.","solutions":["Ensure the Explore root source map sets source[\"Resolver\"] to a value implementing explore.Resolver","In tests, construct the source with the real Resolver returned from NewExploreResolver(...)","Grep your patch set for changes to how the Explore root field is registered and restore the Resolver entry","Upgrade to an official release where this wiring is intact"],"exampleFix":"// before\nsrc := map[string]interface{}{\"resolver\": myResolver} // wrong key/type\n// after\nsrc := map[string]interface{}{\"Resolver\": explore.Resolver(myResolver)}","handlingStrategy":"type-guard","validationCode":"m, ok := s.(map[string]interface{})\nif !ok { return errors.New(\"not a map\") }\nif _, ok := m[\"Resolver\"].(Resolver); !ok {\n    return errors.New(\"source missing usable Resolver\")\n}","typeGuard":"func hasResolver(m map[string]interface{}) (Resolver, bool) {\n    r, ok := m[\"Resolver\"].(Resolver)\n    return r, ok\n}","tryCatchPattern":"resolver, ok := source[\"Resolver\"].(Resolver)\nif !ok {\n    return nil, fmt.Errorf(\"missing usable Resolver in %#v\", source)\n}","preventionTips":["Always build the source map with the exact key \"Resolver\" typed as explore.Resolver","Use the constructor (NewExploreResolver) rather than ad-hoc maps in tests","Keep the key name in a shared constant to avoid renames breaking the contract"],"tags":["graphql","resolver","type-assertion","explore","internal-wiring"],"backgroundTag":"graphql-resolver-source-type-mismatch","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"}