feat(dc): Add executeQuery and executeMutation APIs to Data Connect by stephenarosaj · Pull Request #2979 · firebase/firebase-admin-node

@stephenarosaj

API Changes

  • Added executeQuery() and executeMutation() to src/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

@stephenarosaj

@stephenarosaj

@stephenarosaj

@stephenarosaj

@stephenarosaj

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.

@stephenarosaj

Forgot a few changes! Didn't know that you could close and re-open :P thanks Yuchen!

@stephenarosaj

wait - need to privatize the execute API, execution should come from operation refs (in a future PR)

@stephenarosaj

@stephenarosaj

maneesht

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

@stephenarosaj

@stephenarosaj

@stephenarosaj

…s, bypassing auth policies
…ions, bypassing auth policies

@stephenarosaj

@stephenarosaj

@stephenarosaj

maneesht

maneesht

maneesht

lahirumaramba

lahirumaramba

lahirumaramba

lahirumaramba

lahirumaramba

…uteMutation() unit tests

@stephenarosaj

lahirumaramba

kevinthecheung

kevinthecheung

@stephenarosaj

lahirumaramba

@stephenarosaj