Repository navigation
fix: always send required freeOnly on price constraint - #7
Merged
Merged
Conversation
The tutti GraphQL input type ListingPriceConstraint declares freeOnly as a
required non-null Boolean (freeOnly:Z + checkNotNull in the app's Kotlin
ListingPriceConstraint input adapter); min/max are optional.
SearchBuilder.price() only spread the caller's {min,max}, omitting freeOnly,
so any price-range filter was rejected by the server with:
HTTP 422 GRAPHQL_VALIDATION_FAILED at path prices[0].freeOnly
Default freeOnly to false in .price() (before the spread, so an explicit
value still wins) and make freeOnly required on the PriceConstraint type so
the omission can't recur. Update the README caveat: the price shape is now
verified against the decompiled adapter rather than inferred.
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.
Summary
Price-range searches (
.price({ min, max })) failed with HTTP 422GRAPHQL_VALIDATION_FAILEDat pathprices[0].freeOnly. Root cause: the tutti GraphQL input typeListingPriceConstraintdeclaresfreeOnlyas a required non-null Boolean, butSearchBuilder.price()only spread the caller's{min,max}and omitted it..freeOnly()worked because it set the field explicitly;.price()did not.Root cause (verified, not inferred)
Decompiled app
ListingPriceConstraintinput adapter:freeOnly:Z(primitive boolean) +checkNotNull→ required, always writtenkey: String!→ requiredmin/max→Optional<Double>→ optionalReal input shape:
Changes
src/search/builder.ts— defaultfreeOnly: falsein.price()(before the spread, so an explicit value still wins)src/core/types.ts— makefreeOnlyrequired onPriceConstraintso the omission can't recur; comment cites the adapterREADME.md— price shape is now verified against the decompiled adapter (removed from the "inferred" caveat)Verification
Fake-transport check of the variables
.fetch()sends: