MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / sendMutation

Method sendMutation

lib/helper/GraphQL.js:192–203  ·  view source on GitHub ↗

* Send query to GraphQL endpoint over http * * ```js * I.sendMutation(` * mutation createUser($user: UserInput!) { * createUser(user: $user) { * id * name * email * } * } * `, * { user: { *

(mutation, variables, options = {}, headers = {})

Source from the content-addressed store, hash-verified

190 * @return Promise<any>
191 */
192 async sendMutation(mutation, variables, options = {}, headers = {}) {
193 if (typeof mutation !== 'string') {
194 throw new Error(`mutation expected to be a String, instead received ${typeof mutation}`)
195 }
196 const operation = {
197 query: mutation,
198 variables,
199 ...options,
200 }
201 const request = this._prepareGraphQLRequest(operation, headers)
202 return this._executeQuery(request)
203 }
204
205 _setRequestTimeout(newTimeout) {
206 this.options.timeout = newTimeout

Callers 3

_requestCreateMethod · 0.80
_requestDeleteMethod · 0.80
GraphQL_test.jsFile · 0.80

Calls 2

_executeQueryMethod · 0.95

Tested by

no test coverage detected