UNPKG

860 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.GraphQLSchemaHost = void 0;
4const tslib_1 = require("tslib");
5const common_1 = require("@nestjs/common");
6let GraphQLSchemaHost = class GraphQLSchemaHost {
7 set schema(schemaRef) {
8 this._schema = schemaRef;
9 }
10 get schema() {
11 if (!this._schema) {
12 throw new Error('GraphQL schema has not yet been created. ' +
13 'Make sure to call the "GraphQLSchemaHost#schema" getter when the application is already initialized (after the "onModuleInit" hook triggered by either "app.listen()" or "app.init()" method).');
14 }
15 return this._schema;
16 }
17};
18exports.GraphQLSchemaHost = GraphQLSchemaHost;
19exports.GraphQLSchemaHost = GraphQLSchemaHost = tslib_1.__decorate([
20 (0, common_1.Injectable)()
21], GraphQLSchemaHost);