* Executes mutations sequentially into Dgraph
(dropData = true)
| 182 | * Executes mutations sequentially into Dgraph |
| 183 | */ |
| 184 | async run(dropData = true): Promise<void> { |
| 185 | dropData && (await this.dropData()) |
| 186 | for (const mutation of this.axiosPromises) { |
| 187 | try { |
| 188 | await mutation() |
| 189 | } catch (error: any) { |
| 190 | const { |
| 191 | response: { data: resData, errors } = { data: null, errors: null }, |
| 192 | message, |
| 193 | } = error ?? {} |
| 194 | this.logger.error('There was an issue pushing data into the Dgraph db') |
| 195 | this.logger.debug(message) |
| 196 | processGQLExecutionResult({ resData, errors }) |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | // Ensure mutations array is clean after execution |
| 201 | this.axiosPromises = [] |
| 202 | } |
| 203 | } |
nothing calls this directly
no test coverage detected