Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default (pss: PSS, port: number) => {
const schema = createSchema(pss, port)
const graphqlHandler = microGraphql({ schema })
const graphiqlHandler = microGraphiql({ endpointURL: '/graphql' })
return {
routes: [
get('/graphql', graphqlHandler),
post('/graphql', graphqlHandler),
get('/graphiql', graphiqlHandler),
],
onCreated: (server: Server) => {
SubscriptionServer.create(
{ execute, schema, subscribe },
{ path: '/graphql', server },
)
},
}
}