Repository navigation
Add typed JSON output to app execute - #8814
isaacroldan wants to merge 5 commits into
Conversation
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007114657Caution After installing, validate the version by running |
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007123507Caution After installing, validate the version by running |
3b23d1d to
a2139f8
Compare
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007133858Caution After installing, validate the version by running |
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007140354Caution After installing, validate the version by running |
7b81498 to
85f5cf1
Compare
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261009084750Caution After installing, validate the version by running |
WHY are these changes introduced?
Let scripts read GraphQL results from
app execute. Related to #23671.WHAT is this pull request doing?
Add
--jsonwith native{data, extensions?}results and shared fatal errors with GraphQL details. With--output-file, write the result to the file and return an absolute{path, format}receipt. Preserve text output and leave existing files unchanged on GraphQL failure.For
query { shop { name } }, normal stdout follows the existing success banner:{"shop":{"name":"Test Shop"}}The matching
--jsonresult is:{"data":{"shop":{"name":"Test Shop"}}}The JSON result also includes native
extensionswhen the API supplies them.How to manually test your changes?
Use a linked test app installed on a development store.
shopify app execute --query 'query { shop { name } }' --store <store>.myshopify.com --json --no-input > result.json. Check that stdout contains one object withdata.shop.name.--output-file query.json. Check that stdout contains{path, format}and the file contains the GraphQL result. Repeat without--jsonto compare existing text and file output.--json --output-file query.json. Expect one error object, a nonzero exit, and an unchanged file. Runshopify app execute --json-schemato inspect the contract.Checklist