ent/ent · error

gremlin: no boolean value

Error message

gremlin: no boolean value

What it means

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.

Source

Thrown at dialect/gremlin/response.go:100

	err := rsp.ReadVal(&p)
	return p, err
}

// ReadValueMap returns response data as a value map.
func (rsp *Response) ReadValueMap() (graph.ValueMap, error) {
	var m graph.ValueMap
	err := rsp.ReadVal(&m)
	return m, err
}

// ReadBool returns response data as a bool.
func (rsp *Response) ReadBool() (bool, error) {
	var b [1]*bool
	if err := rsp.ReadVal(&b); err != nil {
		return false, err
	}
	if b[0] == nil {
		return false, errors.New("gremlin: no boolean value")
	}
	return *b[0], nil
}

// ReadInt returns response data as an int.
func (rsp *Response) ReadInt() (int, error) {
	var v [1]*int
	if err := rsp.ReadVal(&v); err != nil {
		return 0, err
	}
	if v[0] == nil {
		return 0, errors.New("gremlin: no integer value")
	}
	return *v[0], nil
}

// ReadString returns response data as a string.
func (rsp *Response) ReadString() (string, error) {

View on GitHub (pinned to 69d5d4deb1)

Solutions

  1. Inspect the actual response with ReadVal(&any) (or dump rsp.Result.Data) to see what the query returned instead of a boolean.
  2. 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.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at dialect/gremlin/response.go:100 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ent/ent@69d5d4deb1 (2026-09-03). Data as JSON: /api/errors/aff1184815b9d9ef. Report an issue: GitHub.