Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = (sbot, plugins, opts) => {
const app = express()
let schemas = []
plugins.map((pl, index) => schemas.push(makeExecutableSchema(pl)))
const schema = mergeSchemas({
schemas,
})
app.use('/graphql', bodyParser.json(), graphqlExpress({ schema, context: { pubsub, sbot }}))
app.use('/playground', altairExpress({
endpointURL: `/graphql`,
subscriptionsEndpoint: `ws://localhost:${PORT}/subscriptions`
}))
app.listen(PORT, () => {
console.log('Started GraphQL server at', PORT)
})
}