@@ -161,7 +161,7 @@ export class RESTTransport implements DataConnectTransport {
161161  invokeQuery : < T ,  U > ( 
162162    queryName : string , 
163163    body ?: U 
164-   )  =>  PromiseLike < {  data : T ;  errors : Error [ ]  } >  =  < T ,  U  =  unknown > ( 
164+   )  =>  Promise < {  data : T ;  errors : Error [ ]  } >  =  < T ,  U  =  unknown > ( 
165165    queryName : string , 
166166    body : U 
167167  )  =>  { 
@@ -174,24 +174,20 @@ export class RESTTransport implements DataConnectTransport {
174174          name : `projects/${ this . _project }  /locations/${ this . _location }  /services/${ this . _serviceName }  /connectors/${ this . _connectorName }  ` , 
175175          operationName : queryName , 
176176          variables : body 
177-         }   as   unknown   as   U ,   // TODO(mtewani): This is a patch, fix this. 
177+         } , 
178178        abortController , 
179179        this . appId , 
180180        this . _accessToken , 
181181        this . _appCheckToken , 
182182        this . _isUsingGen 
183183      ) 
184184    ) ; 
185- 
186-     return  { 
187-       then : withAuth . then . bind ( withAuth ) , 
188-       catch : withAuth . catch . bind ( withAuth ) 
189-     } ; 
185+     return  withAuth ; 
190186  } ; 
191187  invokeMutation : < T ,  U > ( 
192188    queryName : string , 
193189    body ?: U 
194-   )  =>  PromiseLike < {  data : T ;  errors : Error [ ]  } >  =  < T ,  U  =  unknown > ( 
190+   )  =>  Promise < {  data : T ;  errors : Error [ ]  } >  =  < T ,  U  =  unknown > ( 
195191    mutationName : string , 
196192    body : U 
197193  )  =>  { 
@@ -203,20 +199,14 @@ export class RESTTransport implements DataConnectTransport {
203199          name : `projects/${ this . _project }  /locations/${ this . _location }  /services/${ this . _serviceName }  /connectors/${ this . _connectorName }  ` , 
204200          operationName : mutationName , 
205201          variables : body 
206-         }   as   unknown   as   U , 
202+         } , 
207203        abortController , 
208204        this . appId , 
209205        this . _accessToken , 
210206        this . _appCheckToken , 
211207        this . _isUsingGen 
212208      ) ; 
213209    } ) ; 
214- 
215-     return  { 
216-       then : taskResult . then . bind ( taskResult ) , 
217-       // catch: taskResult.catch.bind(taskResult), 
218-       // finally: taskResult.finally.bind(taskResult), 
219-       cancel : ( )  =>  abortController . abort ( ) 
220-     } ; 
210+     return  taskResult ; 
221211  } ; 
222212} 
0 commit comments