UNPKG

@zuu/owl

Version:

Zuu's Experimental GraphQL Implementation

45 lines 1.54 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const graphql_subscriptions_1 = require("graphql-subscriptions"); class BuildContext { static create(options) { if (options.dateScalarMode !== undefined) { this.dateScalarMode = options.dateScalarMode; } if (options.scalarsMap !== undefined) { this.scalarsMaps = options.scalarsMap; } if (options.validate !== undefined) { this.validate = options.validate; } if (options.authChecker !== undefined) { this.authChecker = options.authChecker; } if (options.authMode !== undefined) { this.authMode = options.authMode; } if (options.pubSub !== undefined) { if ("eventEmitter" in options.pubSub) { this.pubSub = new graphql_subscriptions_1.PubSub(options.pubSub); } else { this.pubSub = options.pubSub; } } if (options.globalMiddlewares) { this.globalMiddlewares = options.globalMiddlewares; } } static reset() { this.dateScalarMode = "isoDate"; this.scalarsMaps = []; this.validate = true; this.authChecker = undefined; this.authMode = "error"; this.pubSub = new graphql_subscriptions_1.PubSub(); this.globalMiddlewares = []; } } exports.BuildContext = BuildContext; BuildContext.reset(); //# sourceMappingURL=build-context.js.map