gastownhall/beads · error

type only supports = and != operators

Error message

type only supports = and != operators

What it means

Like status, the type field only supports equality operators. applyTypeFilter rejects any ComparisonNode with Field="type" whose operator is not = or !=. Unlike status, there is no value validation here — any string is accepted as an IssueType and simply won't match unknown types in results.

Source

Thrown at internal/query/evaluator.go:264

		filter.PriorityMax = &max
	case OpLessEq:
		filter.PriorityMax = &priority
	case OpGreater:
		// priority > X means PriorityMin = X+1
		min := priority + 1
		if min > 4 {
			return fmt.Errorf("priority > %d matches nothing", priority)
		}
		filter.PriorityMin = &min
	case OpGreaterEq:
		filter.PriorityMin = &priority
	}
	return nil
}

func (e *Evaluator) applyTypeFilter(comp *ComparisonNode, filter *types.IssueFilter) error {
	if comp.Op != OpEquals && comp.Op != OpNotEquals {
		return fmt.Errorf("type only supports = and != operators")
	}
	issueType := types.IssueType(strings.ToLower(comp.Value))
	if comp.Op == OpEquals {
		filter.IssueType = &issueType
	} else {
		filter.ExcludeTypes = append(filter.ExcludeTypes, issueType)
	}
	return nil
}

func (e *Evaluator) applyAssigneeFilter(comp *ComparisonNode, filter *types.IssueFilter) error {
	if comp.Op != OpEquals {
		return fmt.Errorf("assignee only supports = operator")
	}
	if comp.Value == "" || strings.ToLower(comp.Value) == "none" || strings.ToLower(comp.Value) == "null" {
		filter.NoAssignee = true
	} else {
		filter.Assignee = &comp.Value

View on GitHub (pinned to 71377f2769)

Solutions

  1. Rewrite with = or != : e.g. `type = bug`.
  2. To match multiple types, issue one query per type or use the Go API setting IssueFilter.ExcludeTypes for exclusion.
  3. For fuzzy matching, use the text search fields (title/description) instead of type.

Example fix

// before
"type >= bug"
// after
"type = bug"
Defensive patterns

Strategy: validation

Validate before calling

func validateTypeOp(op query.Op) error {
    if op != query.OpEquals && op != query.OpNotEquals {
        return fmt.Errorf("type supports only = and !=, got %v", op)
    }
    return nil
}

Try / catch

if err := e.applyComparison(comp, filter); err != nil {
    if strings.Contains(err.Error(), "type only supports") {
        return rewriteWithEquals(comp)
    }
    return err
}

Prevention

When it happens

Trigger: Queries like `type > bug`, `type <= feature`, `type ~ task` — Field="type" with Op other than OpEquals/OpNotEquals.

Common situations: SQL habits (`type LIKE ...`); generic query builders that default every field to an ordering operator; confusion between the `type` field and free-text search which does support substring matching.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/a388b2c2cf66fe86. Report an issue: GitHub.