You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(store): open GraphiQL when 'shopify store execute' has no query
When neither --query nor --query-file is provided, 'shopify store execute'
now spins up the GraphiQL HTTP server on a local port (using the
TokenProvider-based server from @shopify/cli-kit/node/graphiql/server),
prints the URL, and opens it in the browser.
- New service: openStoreGraphiQL backs the no-query branch. Token strategy
delegates to loadStoredStoreSession, so the GraphiQL session uses the
credentials previously set up by 'shopify store auth' and benefits from
its expiry/refresh logic.
- New flags: --graphiql-port (env SHOPIFY_FLAG_GRAPHIQL_PORT) chooses the
port; --no-open (env SHOPIFY_FLAG_NO_OPEN) keeps the browser closed.
- --query and --query-file are now optional and mutually exclusive instead
of exactlyOne. Existing non-interactive behavior is unchanged.
- --allow-mutations also gates mutations in the interactive UI, mirroring
the safe-by-default semantics of the non-interactive path. Without it,
the proxy returns HTTP 400 for any mutation operation.
- --output-file and --json log a warning and are ignored in GraphiQL mode.
- Tests cover the routing, flag forwarding, and the openStoreGraphiQL
service (server wiring, token provider, browser open, abort/close).
- README + oclif manifest regenerated; changeset added.
Open an interactive GraphiQL UI when running `shopify store execute` without `--query` or `--query-file`. The GraphiQL session uses the access token previously set up via `shopify store auth`, points at the same Admin GraphQL endpoint as the non-interactive mode, and respects `--allow-mutations` (mutations are blocked by default). The GraphiQL HTTP server has moved into `@shopify/cli-kit/node/graphiql/server` so both `shopify app dev` and `shopify store execute` can reuse it; behavior of `shopify app dev` is unchanged.
Copy file name to clipboardExpand all lines: packages/cli/oclif.manifest.json
+28-6Lines changed: 28 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -5868,13 +5868,14 @@
5868
5868
"args": {
5869
5869
},
5870
5870
"customPluginName": "@shopify/store",
5871
-
"description": "Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.",
5872
-
"descriptionWithMarkdown": "Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data.",
5871
+
"description": "Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nWhen neither `--query` nor `--query-file` is provided, opens a local GraphiQL UI in the browser pointed at the store. Use `--graphiql-port` to choose the port and `--no-open` to keep the browser closed.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data; the same flag controls whether the GraphiQL UI is allowed to issue mutations.",
5872
+
"descriptionWithMarkdown": "Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.\n\nRun `shopify store auth` first to create stored auth for the store.\n\nWhen neither `--query` nor `--query-file` is provided, opens a local GraphiQL UI in the browser pointed at the store. Use `--graphiql-port` to choose the port and `--no-open` to keep the browser closed.\n\nMutations are disabled by default. Re-run with `--allow-mutations` if you intend to modify store data; the same flag controls whether the GraphiQL UI is allowed to issue mutations.",
staticsummary='Execute GraphQL queries and mutations on a store.'
12
+
staticsummary='Execute GraphQL queries and mutations on a store, or open an interactive GraphiQL UI.'
11
13
12
14
staticdescriptionWithMarkdown=`Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.
13
15
14
16
Run \`shopify store auth\` first to create stored auth for the store.
15
17
16
-
Mutations are disabled by default. Re-run with \`--allow-mutations\` if you intend to modify store data.`
18
+
When neither \`--query\` nor \`--query-file\` is provided, opens a local GraphiQL UI in the browser pointed at the store. Use \`--graphiql-port\` to choose the port and \`--no-open\` to keep the browser closed.
19
+
20
+
Mutations are disabled by default. Re-run with \`--allow-mutations\` if you intend to modify store data; the same flag controls whether the GraphiQL UI is allowed to issue mutations.`
0 commit comments