Files
personal_site/frontend/node_modules/graphql-mapping-template/lib/http.js
T

49 lines
1.7 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpMappingTemplate = void 0;
const ast_1 = require("./ast");
class HttpMappingTemplate {
static getRequest({ resourcePath, params }) {
return (0, ast_1.obj)({
version: (0, ast_1.str)(this.RESOLVER_VERSION_ID),
method: (0, ast_1.str)('GET'),
resourcePath: (0, ast_1.str)(resourcePath),
params,
});
}
static postRequest({ resourcePath, params }) {
return (0, ast_1.obj)({
version: (0, ast_1.str)(this.RESOLVER_VERSION_ID),
method: (0, ast_1.str)('POST'),
resourcePath: (0, ast_1.str)(resourcePath),
params,
});
}
static putRequest({ resourcePath, params }) {
return (0, ast_1.obj)({
version: (0, ast_1.str)(this.RESOLVER_VERSION_ID),
method: (0, ast_1.str)('PUT'),
resourcePath: (0, ast_1.str)(resourcePath),
params,
});
}
static deleteRequest({ resourcePath, params }) {
return (0, ast_1.obj)({
version: (0, ast_1.str)(this.RESOLVER_VERSION_ID),
method: (0, ast_1.str)('DELETE'),
resourcePath: (0, ast_1.str)(resourcePath),
params,
});
}
static patchRequest({ resourcePath, params }) {
return (0, ast_1.obj)({
version: (0, ast_1.str)(this.RESOLVER_VERSION_ID),
method: (0, ast_1.str)('PATCH'),
resourcePath: (0, ast_1.str)(resourcePath),
params,
});
}
}
exports.HttpMappingTemplate = HttpMappingTemplate;
HttpMappingTemplate.RESOLVER_VERSION_ID = '2018-05-29';
//# sourceMappingURL=http.js.map