UNPKG

@dipakparmar/ca-business-registry-graphql

Version:
27 lines 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.schema = exports.createCABusinessRegistryGraphQLServer = void 0; const graphql_yoga_1 = require("graphql-yoga"); const node_http_1 = require("node:http"); const schema_1 = require("./schema"); Object.defineProperty(exports, "schema", { enumerable: true, get: function () { return schema_1.schema; } }); const createCABusinessRegistryGraphQLServer = (params) => { const cors = params === null || params === void 0 ? void 0 : params.cors; const graphqlEndpoint = (params === null || params === void 0 ? void 0 : params.graphqlEndpoint) || '/graphql'; const graphiql = (params === null || params === void 0 ? void 0 : params.graphiql) || false; const landingPage = (params === null || params === void 0 ? void 0 : params.landingPage) || false; const context = (context) => { // return return Object.assign({}, context); }; return (0, node_http_1.createServer)((0, graphql_yoga_1.createYoga)({ landingPage, cors, graphiql, graphqlEndpoint, context, schema: schema_1.schema, })); }; exports.createCABusinessRegistryGraphQLServer = createCABusinessRegistryGraphQLServer; //# sourceMappingURL=server.js.map