MCPcopy Index your code
hub / github.com/cloudgraphdev/cli / run

Method run

src/storage/dgraph/index.ts:184–202  ·  view source on GitHub ↗

* Executes mutations sequentially into Dgraph

(dropData = true)

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 2

dropDataMethod · 0.80

Tested by

no test coverage detected