UNPKG

@nestjs/graphql

Version:

Nest - modern, fast, powerful node.js web framework (@graphql)

19 lines (18 loc) 683 B
import { __decorate } from "tslib"; import { Injectable } from '@nestjs/common'; let GraphQLSchemaHost = class GraphQLSchemaHost { set schema(schemaRef) { this._schema = schemaRef; } get schema() { if (!this._schema) { throw new Error('GraphQL schema has not yet been created. ' + '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).'); } return this._schema; } }; GraphQLSchemaHost = __decorate([ Injectable() ], GraphQLSchemaHost); export { GraphQLSchemaHost };