Add --query-file flag to app execute and app bulk execute for loading GraphQL queries from files#6733
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
--query-file to both app execute and app bulk execute--query-file flag to app execute and app bulk execute for loading GraphQL queries from files
Coverage report
Test suite run success3570 tests passing in 1416 suites. Report generated by 🧪jest coverage report action from 1ffab0d |
|
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. |
| if (flags.query) { | ||
| query = flags.query | ||
| } else if (flags['query-file']) { |
There was a problem hiding this comment.
OCLIF should prevent that based on the flag config
| /** | ||
| * Validates bulk operation-specific constraints for variables. | ||
| */ | ||
| function validateBulkOperationVariables(graphqlOperation: string, variablesJsonl?: string): void { |
There was a problem hiding this comment.
I'm assuming this means that normal (non-bulk) GraphQL queries can have variables?
There was a problem hiding this comment.
Correct, this is only invoked for bulk operations

WHY are these changes introduced?
Writing example scripts with
app executeandapp bulk executemade it clear that an argument for this would make the code cleaner and intent more obvious.WHAT is this pull request doing?
Adds a new
--query-fileflag to theapp executeandapp bulk executecommands that allows loading GraphQL queries from a file.Key changes:
--query-fileflag to both operation and bulk operation commands--queryand--query-fileflags mutually exclusiveHow to test your changes?
query.graphqlshopify app execute --query-file query.graphql--queryand--query-filetogether and confirm it failsMeasuring impact
How do we know this change was effective? Please choose one:
Checklist