Repository navigation
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
Open
fix(search-api-graphql)!: serve a range bucket’s bounds in the type its field’s range filter takes#1078ddeboer wants to merge 1 commit into
ddeboer wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 sharedRangeBucket, whoseminandmaxareFloat, so an integer bin’s bounds came back asFloatand not theIntthatIntRangetakes.RangeBucketis now split per kind, the same way the extent types are:IntRangeBucket(Intbounds) andFloatRangeBucket(Floatbounds), next to the existingDateRangeBucket. All three come from one smallrangeBucketTypehelper, and the facet picks one by the field’s kind. The port doesn’t change:FacetBucket.min/maxare still stored terms.This breaks the GraphQL schema because
RangeBucketno longer exists. Clients that name it in fragments or generated types need to switch toIntRangeBucketorFloatRangeBucket.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