Re-land Storefront API 2026-07 migration + fix review issues (v3.0.0) - #147
Conversation
Re-applies PR imsujan276#143 (reverted in imsujan276#146) together with the fixes for the issues found in review. Squashed re-land on top of the revert so the migration is fully restored (a plain re-merge of the branch would not re-introduce the reverted commits). Fixes since the revert: - CartAddressInput is a Storefront "one of" input; toJson emitted both fields, so adding a cart delivery address failed with "'CartAddressInput' requires exactly one argument, but 2 were provided". The null field is now omitted. (This is the delivery error from the revert note.) - Example collection tab hard-coded a price {min:500,max:600} filter that hid all products on most stores (the "collections show no products" from the revert note). Removed it. - Example Blog/Pages tabs spun forever on a failed fetch (catch cleared the flag without setState); they now clear the spinner and show the error or an empty state. - Example builds on the Java 25 / AGP 9 toolchain (Gradle 9.6.1, AGP 9.3.0, built-in Kotlin; flutter_inappwebview 6.2.0-beta.3 for AGP 9). - Dependency floors bumped to current versions (intl kept >=0.20.2 for flutter_localizations compatibility). Verified every migrated document and both delivery paths against a live 2026-07 storefront, ran the example app end-to-end, and confirmed model parsing on real responses. flutter analyze clean; tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Nothing imports analyzer directly; it is only a transitive codegen dependency. Pinning analyzer ^10.2.0 (which requires meta ^1.18.0) made the package unresolvable on Flutter SDKs whose flutter_test pins the older meta 1.17.0 (e.g. the CI runner), even though it resolved on newer local SDKs. Removed the pin so pub picks an analyzer matching the active SDK. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`dart analyze --fatal-infos` (CI) fails with `asset_does_not_exist` when example/pubspec.yaml declares `.env` as an asset but the file is absent — which it is on any clean checkout, since .env is git-ignored (it holds a Storefront token). Re-commented the asset with instructions to create .env and uncomment it locally to run the example. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Hi @qeepcologne Thank you for the update IN the cart tab in the example app, the line item quantity is not being set. The line item quantity is always 0 on line item add, remove, or add to cart. Except for this error in cart module, others seems to be good to go.
|
|
Thanks for testing — I dug into this one and it turns out to be an example-app bug, not a package bug, and it's not new in this PR. Fixed in the example either way, plus I added a regression test on the package side so the parse path is pinned. What's actually happeningShopify creates the line with Reproduced against the public Hydrogen demo store ( It isn't a regressionI ran the pre-migration document from The package parses quantity correctlyTo be sure it wasn't us dropping the field, I checked the whole path:
Added a test ( What I changed in the example
|
|
@qeepcologne Thank you for your update and contribution to the package. The new version 3.0.0 is now available in pub.dev. |

Re-lands #143 (reverted in #146) with fixes for the issues found in review.
Why a new PR (and not a re-merge of the branch)
The reverted migration commits are still in
main's history, so simply re-mergingqeepcologne:mainwould bring only the new fix commits and leave the migration reverted. This branch is a clean re-land committed on top of the current (post-revert)main, so merging it restores the full migration and the fixes in one go.Addressing the revert notes
Not a query/parsing bug — I confirmed
Collection.fromGraphJsonparses real 2026-07 collection products correctly. The example's collection tab hard-coded afilters: {price: {min: 500, max: 600}}, so any store whose products fall outside that range showed an empty collection while the unfiltered product list showed everything. Removed the hard-coded filter (kept a comment showing how to add one).CartAddressInputis a Storefront "one of" input — exactly one field may be present. The generatedtoJsonemitted bothcopyFromCustomerAddressIdanddeliveryAddress, so the null one counted as a second argument. Marked both fields@JsonKey(includeIfNull: false)so the unused one is omitted. Verified live: bothcartCreate(delivery:)andcartDeliveryAddressesAddnow returnuserErrors: []and persist the address.unauthenticated_read_contentscope on the test token (ACCESS_DENIED), but the example also had a bug: thecatchcleared the loading flag withoutsetState, so the spinner never went away. Fixed all three fetches to clear viasetStateand render the actual error (e.g. the scope message) or a "No blogs/pages" empty state.flutter_inappwebviewto6.2.0-beta.3(the stable line's Android package uses a proguard file AGP 9 removed). Also enabled the.envasset (the example'smain.dartloads.envbut the asset was commented out, so it never actually loaded config).Testing
Cart,Collection,Products) — nothing dropped on parse.CartAddressInputone-of serialization.flutter analyzeclean; tests pass.Everything else from #143 is unchanged (the full 2026-07 migration and deprecation cleanup). See #144 for the underlying issue and CHANGELOG for the migration guide.