The Wire · Showcase
CLI TIGHTENS FUNCTION TYPES, LOCKS DOWN NON-INTERACTIVE FLAGS
By RepoJournal · Filed · About Shopify
Shopify Function GraphQL scalars now ship with proper TypeScript mappings instead of unsafe `any` types, while CLI commands gain infrastructure to enforce required flags in automation flows.
The CLI function type generator now maps custom GraphQL scalars to concrete TypeScript types, leaving unknown future scalars as `unknown` rather than the permissive `any` [1]. This closes a type safety gap that hit developers using Shopify Functions in JavaScript and TypeScript projects. In parallel, the CLI is rolling out required non-interactive flag infrastructure across app and theme commands [2]. The `requiredIfNonInteractive` metadata validates direct, alternative, and conditional flag requirements centrally, with all missing flags reported together [2]. App commands like `app init`, deploy, config linking, and function replay now enforce these requirements [3], as do theme selection, deletion, duplication, and publish flows [4]. On the reliability front, CLI removes an obsolete app startup hook that ran on every command but never actually populated the intended cache [5]. In Hydrogen, customer account login now recovers from OAuth state mismatches by retrying the authentication flow once, eliminating `Bad request: Unauthorized` errors when sessions swap or expire mid-flow [6]. The preview release pipeline shifts to changesets-based versioning on the preview branch, making the manual dispatch job obsolete [7].
One email a day. Unsubscribe in one click.
Keep up with Shopify in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review CLI command flags in CI/CD scripts for non-interactive requirements before next deploy Shopify/cli [plan]
- → Update Shopify Function codegen to use new scalar mappings in your projects Shopify/cli [monitor]
- → Test customer login flows in Hydrogen with switched OAuth contexts Shopify/hydrogen [monitor]
References
- [1] Fix Shopify Function GraphQL scalar types ↗ Shopify/cli
- [2] Add infrastructure for required non-interactive flags ↗ Shopify/cli
- [3] Document required non-interactive app flags ↗ Shopify/cli
- [4] Document required non-interactive theme flags ↗ Shopify/cli
- [5] Remove obsolete app startup hook ↗ Shopify/cli
- [6] Recover customer account login from OAuth state mismatches ↗ Shopify/hydrogen
- [7] Remove the manual preview release job (#3889) Shopify/hydrogen