Skip to content

Conversation

@ericlee878
Copy link
Contributor

@ericlee878 ericlee878 commented Nov 14, 2025

Resolves: https://github.com/shop/issues-api-foundations/issues/1047?issue=shop%7Cissues-api-foundations%7C1097

Background

Variables are only supported for bulkOperationRunMutation, not bulkOperationRunQuery.

The workflow of the CLI command is shown here. This PR is represented by the leftmost side of this diagram.

Testing

Try running

pnpm shopify:run app execute \
  --path ./<TEST APP> \
  -q '{ products(first: 10) { edges { node { id title } } } }'\
  -v '[{"input": {"id": "gid://shopify/Product/<PRODUCT ID>", "tags": ["bulk-test"]}}]'

This should error because queries do not support variables.

Screenshot 2025-11-13 at 11.35.40 PM.png

While,

pnpm shopify:run app execute \
  --path ./coffee-and-more \
  -q '{ products(first: 10) { edges { node { id title } } } }'\

should return a successful BulkOps Query.

Screenshot 2025-11-13 at 11.39.01 PM.png

Copy link
Contributor Author

ericlee878 commented Nov 14, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Nov 14, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
79.2% (-0.03% 🔻)
13647/17232
🟡 Branches
73.08% (-0.03% 🔻)
6649/9098
🟡 Functions
79.34% (-0.03% 🔻)
3518/4434
🟡 Lines
79.55% (-0.03% 🔻)
12890/16203
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / bulk-operation-run-mutation.ts
100% 100% 100% 100%
🟢
... / bulk-operation-run-query.ts
100% 100% 100% 100%
🟢
... / staged-uploads-create.ts
100% 100% 100% 100%
🟢
... / execute-bulk-operation.ts
95.24% 85.71% 100% 95%
🟢
... / run-mutation.ts
100% 100% 100% 100%
🟢
... / run-query.ts
100% 100% 100% 100%
🟡
... / stage-file.ts
74.29% 53.33% 85.71% 73.53%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / ConcurrentOutput.tsx
98.36% (-1.64% 🔻)
92% (-4% 🔻)
100%
98.33% (-1.67% 🔻)
🔴
... / ui.tsx
50.82% (-0.79% 🔻)
42.86% (-5.53% 🔻)
54.55% (+1.42% 🔼)
50% (-0.82% 🔻)
🟡
... / theme-environment.ts
69.57% (-1.86% 🔻)
50%
55.56% (-3.27% 🔻)
69.57% (-1.86% 🔻)

Test suite run success

3368 tests passing in 1380 suites.

Report generated by 🧪jest coverage report action from f788315

@ericlee878 ericlee878 marked this pull request as ready for review November 14, 2025 07:39
@ericlee878 ericlee878 requested a review from a team as a code owner November 14, 2025 07:39
@github-actions
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch from c8489d4 to 8585482 Compare November 14, 2025 21:28
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch from 3f5f064 to c58309a Compare November 14, 2025 21:28
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch from 8585482 to c9000b4 Compare November 14, 2025 22:03
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch from c58309a to 7482fe1 Compare November 14, 2025 22:03
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch from c9000b4 to 4061ac4 Compare November 14, 2025 22:16
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch from 7482fe1 to c58309a Compare November 14, 2025 22:16
@ericlee878 ericlee878 changed the title Add erroring for when variables are given for aBulkOps query Add erroring for when variables are given for a BulkOps query Nov 14, 2025
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch from c58309a to d354318 Compare November 14, 2025 23:01
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch 2 times, most recently from 92ecc87 to 068586a Compare November 14, 2025 23:19
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch from d354318 to 4cb5dbf Compare November 14, 2025 23:19
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch from 068586a to ae921e6 Compare November 14, 2025 23:58
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch 2 times, most recently from 127aa7e to 649d394 Compare November 14, 2025 23:59
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch 2 times, most recently from 4151ee6 to 930b237 Compare November 15, 2025 00:04
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch 2 times, most recently from 273b5f0 to ec07863 Compare November 15, 2025 00:22
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch from 930b237 to 7a9ed81 Compare November 15, 2025 00:22
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch from ec07863 to 9ef34e2 Compare November 17, 2025 23:07
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch from 7a9ed81 to f94d737 Compare November 17, 2025 23:07
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch from 9ef34e2 to cb801fe Compare November 17, 2025 23:50
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch from 3a4833e to 3040057 Compare November 18, 2025 02:41
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch from 742d51c to 1e7de33 Compare November 18, 2025 02:41
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch from 3040057 to 0cc8214 Compare November 18, 2025 22:14
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch from 1e7de33 to 5b0a797 Compare November 18, 2025 22:14
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch from 0cc8214 to 9cfc66c Compare November 18, 2025 22:17
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch 2 times, most recently from fc9f640 to af1941b Compare November 18, 2025 22:27
@ericlee878 ericlee878 force-pushed the 11-10-implement-bulkops-mutation-to-cli branch from 9cfc66c to b07001c Compare November 18, 2025 22:27
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch 2 times, most recently from 8582fa3 to e9edae7 Compare November 19, 2025 21:23
@github-actions
Copy link
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/ui.d.ts
@@ -1,5 +1,4 @@
 import { FatalError as Fatal } from './error.js';
-import { TokenizedString } from './output.js';
 import { ConcurrentOutputProps } from '../../private/node/ui/components/ConcurrentOutput.js';
 import { handleCtrlC, render } from '../../private/node/ui.js';
 import { AlertOptions } from '../../private/node/ui/alert.js';
@@ -332,23 +331,21 @@ interface RenderTasksOptions {
  * Installing dependencies ...
  */
 export declare function renderTasks<TContext>(tasks: Task<TContext>[], { renderOptions, noProgressBar }?: RenderTasksOptions): Promise<TContext>;
-export interface RenderSingleTaskOptions<T> {
-    title: TokenizedString;
-    task: (updateStatus: (status: TokenizedString) => void) => Promise<T>;
-    renderOptions?: RenderOptions;
-}
 /**
- * Awaits a single task and displays a loading bar while it's in progress. The task's result is returned.
+ * Awaits a single promise and displays a loading bar while it's in progress. The promise's result is returned.
  * @param options - Configuration object
- * @param options.title - The initial title to display with the loading bar
- * @param options.task - The async task to execute. Receives an updateStatus callback to change the displayed title.
- * @param options.renderOptions - Optional render configuration
- * @returns The result of the task
+ * @param options.title - The title to display with the loading bar
+ * @param options.taskPromise - The promise to track
+ * @param renderOptions - Optional render configuration
+ * @returns The result of the promise
  * @example
  * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  * Loading app ...
  */
-export declare function renderSingleTask<T>({ title, task, renderOptions }: RenderSingleTaskOptions<T>): Promise<T>;
+export declare function renderSingleTask<T>({ title, taskPromise }: {
+    title: string;
+    taskPromise: Promise<T> | (() => Promise<T>);
+}, { renderOptions }?: RenderTasksOptions): Promise<T>;
 export interface RenderTextPromptOptions extends Omit<TextPromptProps, 'onSubmit'> {
     renderOptions?: RenderOptions;
 }
packages/cli-kit/dist/private/node/ui/components/SingleTask.d.ts
@@ -1,9 +1,8 @@
-import { TokenizedString } from '../../../../public/node/output.js';
-interface SingleTaskProps<T> {
-    title: TokenizedString;
-    task: (updateStatus: (status: TokenizedString) => void) => Promise<T>;
-    onComplete?: (result: T) => void;
+import React from 'react';
+interface SingleTaskProps {
+    title: string;
+    taskPromise: Promise<unknown>;
     noColor?: boolean;
 }
-declare const SingleTask: <T>({ task, title, onComplete, noColor }: SingleTaskProps<T>) => JSX.Element | null;
+declare const SingleTask: ({ taskPromise, title, noColor }: React.PropsWithChildren<SingleTaskProps>) => JSX.Element | null;
 export { SingleTask };
\ No newline at end of file

@jordanverasamy jordanverasamy changed the base branch from 11-10-implement-bulkops-mutation-to-cli to graphite-base/6622 November 20, 2025 17:40
@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch from e9edae7 to 5e6055a Compare November 20, 2025 17:50
@graphite-app graphite-app bot changed the base branch from graphite-base/6622 to main November 20, 2025 17:51
@graphite-app
Copy link

graphite-app bot commented Nov 20, 2025

Merge activity

  • Nov 20, 5:51 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

@ericlee878 ericlee878 force-pushed the 11-14-implement-erroring-for-query-with-variable branch from 5e6055a to f788315 Compare November 20, 2025 17:57
@ericlee878 ericlee878 added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit 9f10bdf Nov 20, 2025
43 of 45 checks passed
@ericlee878 ericlee878 deleted the 11-14-implement-erroring-for-query-with-variable branch November 20, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants