Skip to content

Add typed JSON output to app execute - #8814

Open
isaacroldan wants to merge 5 commits into
mainfrom
codex/json-app-execute
Open

isaacroldan wants to merge 5 commits into
mainfrom
codex/json-app-execute

Conversation

@isaacroldan

@isaacroldan isaacroldan commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Let scripts read GraphQL results from app execute. Related to #23671.

WHAT is this pull request doing?

Add --json with 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 --json result is:

{"data":{"shop":{"name":"Test Shop"}}}

The JSON result also includes native extensions when the API supplies them.

How to manually test your changes?

Use a linked test app installed on a development store.

  1. Run shopify app execute --query 'query { shop { name } }' --store <store>.myshopify.com --json --no-input > result.json. Check that stdout contains one object with data.shop.name.
  2. Add --output-file query.json. Check that stdout contains {path, format} and the file contains the GraphQL result. Repeat without --json to compare existing text and file output.
  3. Run an invalid query with --json --output-file query.json. Expect one error object, a nonzero exit, and an unchanged file. Run shopify app execute --json-schema to inspect the contract.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • Added the required changeset

@github-actions github-actions Bot added shopify.dev preview Area: @shopify/cli @shopify/cli package issues labels Oct 7, 2026
@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from de835288f83e25a1a9be06db033aeee960fadd29. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007114657

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from a633900336710f7ab8afb204d2e3c3baca6260e0. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007123507

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@isaacroldan
isaacroldan force-pushed the codex/json-app-execute branch from 3b23d1d to a2139f8 Compare October 7, 2026 13:32
@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from a2139f8a2037700a084cc82f8b56537cd416551a. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007133858

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from 7b81498888f0ef790e93680f23769e2ddf629d1b. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007140354

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@isaacroldan
isaacroldan force-pushed the codex/json-app-execute branch from 7b81498 to 85f5cf1 Compare October 8, 2026 15:47
@isaacroldan
isaacroldan marked this pull request as ready for review October 8, 2026 16:02
@isaacroldan
isaacroldan requested review from a team as code owners October 8, 2026 16:02
@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from 85f5cf15c84c273fbca9ee5913c0ae6cd3e0a0b1. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261009084750

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants