()
| 6 | import { context } from './context' |
| 7 | |
| 8 | async function StartServer() { |
| 9 | const apollo = new ApolloServer<BaseContext>({ |
| 10 | typeDefs, |
| 11 | resolvers, |
| 12 | }) |
| 13 | |
| 14 | await apollo.start() |
| 15 | |
| 16 | const app = new Server({ |
| 17 | port: 4000, |
| 18 | }) |
| 19 | |
| 20 | await app.register({ |
| 21 | plugin: hapiApollo, |
| 22 | options: { |
| 23 | path: '/graphql', |
| 24 | context: async () => (context), |
| 25 | apolloServer: apollo, |
| 26 | } |
| 27 | }); |
| 28 | await app.start() |
| 29 | } |
| 30 | |
| 31 | StartServer() |
| 32 | .then((server) => { |