MCPcopy
hub / github.com/ever-co/ever-demand / configure

Method configure

packages/core/src/app.module.ts:201–232  ·  view source on GitHub ↗
(consumer: MiddlewareConsumer)

Source from the content-addressed store, hash-verified

199 }
200
201 configure(consumer: MiddlewareConsumer) {
202
203 console.log(chalk.green(`Configuring NestJS ApplicationModule`));
204
205 // trick for GraphQL vs MongoDB ObjectId type.
206 // See https://github.com/apollographql/apollo-server/issues/1633 and
207 // https://github.com/apollographql/apollo-server/issues/1649#issuecomment-420840287
208 const { ObjectId } = mongoose.Types;
209
210 ObjectId.prototype.valueOf = function () {
211 return this.toString();
212 };
213
214 /* Next is code which could be used to manually create GraphQL Server instead of using GraphQLModule.forRoot(...)
215
216 const schema: GraphQLSchema = this.createSchema();
217 const server: ApolloServer = this.createServer(schema);
218
219 // this creates manually GraphQL subscriptions server (over ws connection)
220 this.subscriptionsService.createSubscriptionServer(server);
221
222 const app: any = this.httpServerRef;
223
224 const graphqlPath = '/graphql';
225
226 server.applyMiddleware({app, path: graphqlPath});
227
228 */
229
230 log.info(`GraphQL Playground available at http://${host}:${port}/graphql`);
231 console.log(chalk.green(`GraphQL Playground available at http://${host}:${port}/graphql`));
232 }
233
234 /*
235 Creates GraphQL Apollo Server manually

Callers 1

toPaymentStageMethod · 0.80

Calls 2

logMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected