Skip to content

Add refresh-function-schemas.sh helper#397

Open
saga-dasgupta wants to merge 1 commit intomainfrom
sd.refresh-function-schemas
Open

Add refresh-function-schemas.sh helper#397
saga-dasgupta wants to merge 1 commit intomainfrom
sd.refresh-function-schemas

Conversation

@saga-dasgupta
Copy link
Copy Markdown
Contributor

@saga-dasgupta saga-dasgupta commented Apr 21, 2026

Summary

Adds refresh-function-schemas.sh — a helper for regenerating schema.graphql across every function template in the repo. Useful whenever you bump api_version in a shopify.extension.toml.liquid or a function's schema changes upstream.

For every (function_type, flavor) pair in templates.json, the script:

  1. Expands liquid templates locally (rust, vanilla-js, wasm).
  2. Symlinks each flavor's template dir into a linked Shopify app's extensions/ folder.
  3. Runs shopify app function schema against that template's own api_version, so flavors can pin different versions without overwriting each other.

Nothing is cloned from GitHub — whatever is in your working tree is what gets refreshed.

Usage

See the Refreshing schema.graphql section added to the README, or:

./refresh-function-schemas.sh --help

Test plan

  • ./refresh-function-schemas.sh --help renders
  • ./refresh-function-schemas.sh --app-dir ~/dev-app --only cart_transform refreshes one function's schemas
  • Full run rewrites every function's schema.graphql in place

Automates regenerating schema.graphql for every (function, flavor) pair
in templates.json. Expands liquid templates locally, symlinks each
flavor dir into a linked Shopify app's extensions/ folder, then runs
`shopify app function schema` against each template's own api_version.
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.

1 participant