gotql
Version:
A GraphQL query framework for serverside apps
27 lines • 1.12 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.mutation = mutation;
/* istanbul ignore file */
const got_1 = __importDefault(require("got"));
const debug_1 = __importDefault(require("debug"));
const runner_1 = require("./modules/runner");
const generics_1 = require("./types/generics");
const info = (0, debug_1.default)('gotql:info');
/**
* Performs a mutation on the specified GraphQL endpoint
*
* @param {string} endPoint GraphQL Endpoint
* @param {queryType} query The JSON gotQL query object
* @param {userOpts} [options] User options
* @public
* @return {Promise<any>} A response object containing all the data
*/
function mutation(endPoint, query, options) {
const client = options && options.gotInstance ? options.gotInstance : got_1.default;
info('Starting a new mutation');
return (0, runner_1.run)(endPoint, query, generics_1.GotQL.ExecutionType.MUTATION, client, options);
}
//# sourceMappingURL=mutation.js.map
;