Skip to content

Conversation

yuchenshi
Copy link
Member

@yuchenshi yuchenshi commented Oct 7, 2025

Description

This adds a new command to execute Data Connect operations.

DO NOT MERGE: API still in review.

Scenarios Tested

image

See Sample Commands below for more.

Sample Commands

firebase dataconnect:execute MyOperation
firebase dataconnect:execute my-connector MyOperation
firebase dataconnect:execute ./my-file.gql
firebase dataconnect:execute ./my-file.gql MyOperation

Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
});
}

// Log the body to stdout to allow pipe processing (even with .errors).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work quite nicely since errors thrown (below, if any) are also logged to stdout (globally handled). Piping to jq for example can choke on the extra output

} else {
if (fileOrConnector === "-") {
stdinUsedFor = "operation source code";
if (process.stdin.isTTY) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed internally, I tried to throw an error if options.nonInteractive but that creates a false positive when --json is passed, since --json right now implies options.nonInteractive (handled globally).

I don't think erroring on --json matches user intention, so I left that part out.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant