{"record":{"id":"aff1184815b9d9ef","repo":"ent/ent","slug":"gremlin-no-boolean-value","errorCode":null,"errorMessage":"gremlin: no boolean value","messagePattern":"gremlin: no boolean value","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dialect/gremlin/response.go","lineNumber":100,"sourceCode":"\terr := rsp.ReadVal(&p)\n\treturn p, err\n}\n\n// ReadValueMap returns response data as a value map.\nfunc (rsp *Response) ReadValueMap() (graph.ValueMap, error) {\n\tvar m graph.ValueMap\n\terr := rsp.ReadVal(&m)\n\treturn m, err\n}\n\n// ReadBool returns response data as a bool.\nfunc (rsp *Response) ReadBool() (bool, error) {\n\tvar b [1]*bool\n\tif err := rsp.ReadVal(&b); err != nil {\n\t\treturn false, err\n\t}\n\tif b[0] == nil {\n\t\treturn false, errors.New(\"gremlin: no boolean value\")\n\t}\n\treturn *b[0], nil\n}\n\n// ReadInt returns response data as an int.\nfunc (rsp *Response) ReadInt() (int, error) {\n\tvar v [1]*int\n\tif err := rsp.ReadVal(&v); err != nil {\n\t\treturn 0, err\n\t}\n\tif v[0] == nil {\n\t\treturn 0, errors.New(\"gremlin: no integer value\")\n\t}\n\treturn *v[0], nil\n}\n\n// ReadString returns response data as a string.\nfunc (rsp *Response) ReadString() (string, error) {","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/ent/ent/blob/69d5d4deb19599f129166634e09d33addcf3f2cc/dialect/gremlin/response.go#L82-L118","documentation":"ReadBool decodes the response's first value into a *bool and dereferences it. This guard fires when decoding succeeded but produced a null/absent value (b[0] == nil) — the server returned a response whose data does not contain a boolean where one was expected. The offending input is the response payload's null first element, not a malformed encoding.","triggerScenarios":"Thrown at dialect/gremlin/response.go:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the actual response with ReadVal(&any) (or dump rsp.Result.Data) to see what the query returned instead of a boolean.","Fix the Gremlin query so the first result element is a boolean (e.g. has(...) or count-based predicates), or use the appropriate Read* accessor for the returned type."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"69d5d4deb19599f129166634e09d33addcf3f2cc","analyzedAt":"2026-09-03T16:51:39.799Z","contentChangedAt":"2026-09-03T16:51:39.799Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}