@@ -30,11 +30,11 @@ const API_VERSION = 'v1';
3030// TODO: CHANGE THIS BACK TO PROD - AUTOPUSH IS ONLY USED FOR LOCAL TESTING BEFORE CHANGES PROPAGATE
3131/** The Firebase Data Connect backend service URL format. */
3232const FIREBASE_DATA_CONNECT_SERVICES_URL_FORMAT =
33- 'https://autopush- firebasedataconnect.sandbox .googleapis.com/{version}/projects/{projectId}/locations/{locationId}/services/{serviceId}:{endpointId}' ;
33+ 'https://firebasedataconnect.googleapis.com/{version}/projects/{projectId}/locations/{locationId}/services/{serviceId}:{endpointId}' ;
3434
3535/** The Firebase Data Connect backend connector URL format. */
3636const FIREBASE_DATA_CONNECT_CONNECTORS_URL_FORMAT =
37- 'https://autopush- firebasedataconnect.sandbox .googleapis.com/{version}/projects/{projectId}/locations/{locationId}/services/{serviceId}/connectors/{connectorId}:{endpointId}' ;
37+ 'https://firebasedataconnect.googleapis.com/{version}/projects/{projectId}/locations/{locationId}/services/{serviceId}/connectors/{connectorId}:{endpointId}' ;
3838
3939/** Firebase Data Connect service URL format when using the Data Connect emulator. */
4040const FIREBASE_DATA_CONNECT_EMULATOR_SERVICES_URL_FORMAT =
@@ -146,35 +146,36 @@ export class DataConnectApiClient {
146146 /**
147147 * Executes a GraphQL query with impersonation.
148148 *
149- * @param options - The GraphQL options, including impersonation details.
149+ * @param options - The GraphQL options. Must include impersonation details.
150150 * @returns A promise that fulfills with the GraphQL response.
151151 */
152- public async impersonateQuery < GraphqlResponse , Variables > (
152+ public async executeQuery < GraphqlResponse , Variables > (
153153 options : GraphqlOptions < Variables >
154154 ) : Promise < ExecuteGraphqlResponse < GraphqlResponse > > {
155- return this . impersonateHelper ( IMPERSONATE_QUERY_ENDPOINT , options ) ;
155+ return this . executeOperationHelper ( IMPERSONATE_QUERY_ENDPOINT , options ) ;
156156 }
157157
158158 /**
159159 * Executes a GraphQL mutation with impersonation.
160160 *
161- * @param options - The GraphQL options, including impersonation details.
161+ * @param options - The GraphQL options. Must include impersonation details.
162162 * @returns A promise that fulfills with the GraphQL response.
163163 */
164- public async impersonateMutation < GraphqlResponse , Variables > (
164+ public async executeMutation < GraphqlResponse , Variables > (
165165 options : GraphqlOptions < Variables >
166166 ) : Promise < ExecuteGraphqlResponse < GraphqlResponse > > {
167- return this . impersonateHelper ( IMPERSONATE_MUTATION_ENDPOINT , options ) ;
167+ return this . executeOperationHelper ( IMPERSONATE_MUTATION_ENDPOINT , options ) ;
168168 }
169169
170170 /**
171- * A helper function to make impersonated GraphQL requests.
171+ * A helper function to execute operations by making requests to FDC's impersonate
172+ * operations endpoints.
172173 *
173174 * @param endpoint - The endpoint to call.
174175 * @param options - The GraphQL options, including impersonation details.
175176 * @returns A promise that fulfills with the GraphQL response.
176177 */
177- private async impersonateHelper < GraphqlResponse , Variables > (
178+ private async executeOperationHelper < GraphqlResponse , Variables > (
178179 endpoint : string ,
179180 options : GraphqlOptions < Variables >
180181 ) : Promise < ExecuteGraphqlResponse < GraphqlResponse > > {
@@ -200,8 +201,8 @@ export class DataConnectApiClient {
200201 if ( this . connectorConfig . connector === undefined || this . connectorConfig . connector === '' ) {
201202 throw new FirebaseDataConnectError (
202203 DATA_CONNECT_ERROR_CODE_MAPPING . INVALID_ARGUMENT ,
203- '` connectorConfig.connector` field used to instantiate Data Connect instance \
204- must be a non-empty string (the connectorId) when calling impersonate APIs.' ) ;
204+ `The ' connectorConfig.connector' field used to instantiate your Data Connect
205+ instance must be a non-empty string (the connectorId) when calling executeQuery or executeMutation.` ) ;
205206 }
206207
207208 const data = {
0 commit comments