Skip to content

fix(search-api-graphql)!: serve a range bucket’s bounds in the type its field’s range filter takes - #1078

Open
ddeboer wants to merge 1 commit into
mainfrom
fix/range-bucket-bound-types
Open

ddeboer wants to merge 1 commit into
mainfrom
fix/range-bucket-bound-types

Conversation

@ddeboer

@ddeboer ddeboer commented Nov 14, 2026

Copy link
Copy Markdown
Member

The date half of this issue landed with #991: a binned date facet’s buckets are already DateRangeBucket, with ISO 8601 bounds. What was left was the numbers. A binned integer or number facet still returned the one shared RangeBucket, whose min and max are Float, so an integer bin’s bounds came back as Float and not the Int that IntRange takes.

RangeBucket is now split per kind, the same way the extent types are: IntRangeBucket (Int bounds) and FloatRangeBucket (Float bounds), next to the existing DateRangeBucket. All three come from one small rangeBucketType helper, and the facet picks one by the field’s kind. The port doesn’t change: FacetBucket.min/max are still stored terms.

This breaks the GraphQL schema because RangeBucket no longer exists. Clients that name it in fragments or generated types need to switch to IntRangeBucket or FloatRangeBucket.

Branch coverage dropped from 98.83% to 98.82% because the nested ternary that chose between the two old bucket types is gone, so I lowered the threshold to match and left a comment in vite.config.ts, as the file does for earlier changes like this.

Fixes #948

…ts field’s range filter takes

A binned integer or number facet’s buckets were the one shared RangeBucket,
whose bounds are Float. An integer bin’s bounds now come back as Int, so they
feed straight into IntRange, the same way the extent types and DateRangeBucket
already work.

BREAKING CHANGE: RangeBucket is gone. A binned integer facet’s buckets are
IntRangeBucket (min/max: Int) and a binned number facet’s are FloatRangeBucket
(min/max: Float); rename RangeBucket in fragments and client types accordingly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serve a range bucket’s bounds in the type its field’s range filter takes

1 participant