| 235 | Creates GraphQL Apollo Server manually |
| 236 | */ |
| 237 | createServer(schema: GraphQLSchema): ApolloServer { |
| 238 | |
| 239 | const playgroundOptions: ApolloServerPluginLandingPageGraphQLPlaygroundOptions = |
| 240 | { |
| 241 | endpoint: `http://${host}:${port}/graphql`, |
| 242 | subscriptionEndpoint: `ws://${host}:${port}/subscriptions`, |
| 243 | settings: { |
| 244 | 'editor.theme': 'dark' |
| 245 | } |
| 246 | }; |
| 247 | |
| 248 | return new ApolloServer({ |
| 249 | schema, |
| 250 | context: ({ req, res }) => ({ |
| 251 | req, |
| 252 | }), |
| 253 | plugins: [ |
| 254 | ApolloServerPluginLandingPageGraphQLPlayground(playgroundOptions) |
| 255 | ] |
| 256 | }); |
| 257 | } |
| 258 | |
| 259 | |
| 260 | /* |