-
Notifications
You must be signed in to change notification settings - Fork 215
Implement mutation support for BulkOps CLI command #6596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3367 tests passing in 1380 suites. Report generated by 🧪jest coverage report action from aad7af4 |
8d8577c to
bfcac3b
Compare
c658f01 to
8b95f00
Compare
bfcac3b to
94bc2e2
Compare
8b95f00 to
7dc25cf
Compare
94bc2e2 to
ed2bd19
Compare
2ef312a to
f813e73
Compare
4e07e3b to
65f1d93
Compare
f813e73 to
0e625de
Compare
65f1d93 to
8f6a1f5
Compare
0e625de to
4024e20
Compare
8f6a1f5 to
a6cdaba
Compare
a6645ff to
3784bae
Compare
a6cdaba to
ac6e796
Compare
ac6e796 to
85c5abb
Compare
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
85c5abb to
2cd36fd
Compare
d8db357 to
3a4833e
Compare
packages/app/src/cli/services/bulk-operations/execute-bulk-operation.test.ts
Outdated
Show resolved
Hide resolved
packages/app/src/cli/services/bulk-operations/execute-bulk-operation.test.ts
Outdated
Show resolved
Hide resolved
jordanverasamy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another pass! Looking really good. I like the changes to stageFile, thanks for being patient with me on those :)
3a4833e to
3040057
Compare
9cfc66c to
b07001c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work. I 🎩 and things are good. Looking forward to getting this in!
|
Thanks for adding this! |
|
/snapit |
|
🫰✨ Thanks @nickwesselman! Your snapshot has been published to npm. Test the snapshot by installing your package globally: npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/[email protected]Caution After installing, validate the version by running just |
nickwesselman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command namespace (shopify app bulk execute) and executing with the app's api key are important before merging this one 👍
|
Mentioned elsewhere, but moving to |
b07001c to
5c60deb
Compare
5c60deb to
aad7af4
Compare
Follow up ticket |
nickwesselman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with my remaining requests as follow-ups



Resolves: https://github.com/orgs/shop/projects/208/views/34?pane=issue&itemId=137773625&issue=shop%7Cissues-api-foundations%7C1069
Background
The basic setup of the BulkOps CLI command was done here. The basic command used BulkOps Query. We are implementing BulkOps Mutation in this PR.
Implementation Details
We parse the query given to us in the flag to determine if the GraphQL command is a query or a mutation. Then, we do the respective GraphQL API call.
Bulk operation CLI accept variables via the
--variablesflag in JSON format. However, the Shopify Admin API requires these variables to be uploaded as a JSONL file rather than passed inline. So, in thestage-file.tsfile, we needed to:There will be a future PR that deals with creating a
--variable-fileflag that links to a file containing the values for bulk mutations, in JSONL format.Used GraphQL code generation configuration for the bulkOperationRunMutation API and stagedUpload API. Ran
pnpm graphql-codegento generate TypeScript types from GraphQL queries/mutationsArchitecture improvements:
executeBulkOperationlevel viaensureAuthenticatedAdmin, then the session is passed down torunBulkOperationQueryandrunBulkOperationMutationexecuteBulkOperation(...flags) instead of parsing individual properties.Testing
1. Follow the instructions here to setup a test app
2. Go here and create a store (if not already have one).
To test the mutation part of the CLI, run: