UNPKG

@pothos/plugin-scope-auth

Version:

A Pothos plugin for adding scope based authorization checks to your GraphQL Schema

39 lines (38 loc) 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "ForbiddenError", { enumerable: true, get: function() { return ForbiddenError; } }); const _core = require("@pothos/core"); const _types = require("./types"); function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } class ForbiddenError extends _core.PothosValidationError { constructor(message, result){ super(message), _define_property(this, "code", 'FORBIDDEN'), _define_property(this, "result", void 0); this.name = 'ForbiddenError'; this.result = result !== null && result !== void 0 ? result : { kind: _types.AuthScopeFailureType.Unknown }; Object.defineProperty(this, 'name', { value: 'ForbiddenError' }); } } //# sourceMappingURL=errors.js.map