feat(dc): Add executeQuery and executeMutation APIs to Data Connect by stephenarosaj · Pull Request #2979 · firebase/firebase-admin-node
API Changes
- Added
executeQuery()andexecuteMutation()tosrc/data-connect/data-connect.ts. These allow users to call deployed operations with impersonated auth credentials.
Testing
- New unit tests added which match the coverage of existing
executeGraphql*APIs - New integration tests added which more than match the coverage of existing
executeGraphql*APIs - The tests pass locally, but a re-deploy of dataconnect to the CI/CD firebase project is required. Tagging @lahirumaramba
Note:
The integration tests have a huge diff because I moved the existing tests under a new parent describe(), and so their indentation level was increased. Existing tests were not changed in this PR.
wait - need to privatize the execute API, execution should come from operation refs (in a future PR)
| user_upsert(data: { id: "fred_id", address: "32 Elm St.", name: "Fred" }) | ||
| } | ||
| mutation updateFredrickUserImpersonation @auth(level: USER) { | ||
| mutation updateFredrickUserImpersonation @auth(level: USER, insecureReason: "test") { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: These changes likely require a re-deploy on the CI project
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they deff do - I'll leave this comment open to make sure it gets re-deployed! Tagging @lahirumaramba
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters