Egor Yurtaev

Results 18 comments of Egor Yurtaev

You can try to reuse `findById`: ```js schemaComposer.Query.addFields({ ...requireMiddlewares([authMiddleware, permissionCustomerMiddleware], { me: SysUserTC.mongooseResolvers .findById({ lean: true }) .setDescription("Current User's Profile") .removeArg("_id") // (rp) => { const { userId } =...

`requireMiddlewares` just helper ```js /** * Add middlewares to resolvers * https://graphql-compose.github.io/docs/api/Resolver.html#withmiddlewares */ export const requireMiddlewares = ( middlewares: Array = [], resolvers: ObjMap, ): ObjMap => { Object.keys(resolvers).forEach((k) =>...

Do you use `root` database user? You can try to change parameter `max_connections` for postgresql https://wiki.postgresql.org/wiki/Number_Of_Database_Connections & http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html

It's a good question. I've tested this use case and I saw 50 connections which were not closed. Currently, I have no idea why it happens. I've added the issue...

Just mock: ```js jest.mock('./db.config.js', () => jest.fn().mockResolvedValue()) beforeAll(() => { mockingoose(User).toReturn(userFixture, 'save'); }) ```

You have to import like this for version >= v2.14.0: ```js import * as mockingoose from 'mockingoose' ```

@mseld Maybe it will help you https://github.com/peecky/node-buffering

@danimayfield Did you try to use dataloader? ```js DocumentCollectionTC.getFieldOTC('items').addRelation('documents', { resolver: () => DocumentTC.mongooseResolvers.dataLoaderMany({ lean: true }), prepareArgs: { _ids: source => source.documents || [], }, projection: { documents: true...