File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 77} from 'graphql' ;
88import { Resolver , TypeComposer } from 'graphql-compose' ;
99import findById from './findById' ;
10- import { projectionHelper } from './helpers/projection' ;
1110import GraphQLMongoID from '../types/mongoid' ;
1211import typeStorage from '../typeStorage' ;
1312import type {
@@ -82,7 +81,7 @@ export default function removeById(
8281 // So empty projection returns all fields.
8382 resolveParams . projection = { } ;
8483
85- // FlowFixMe
84+ // $ FlowFixMe
8685 return findByIdResolver . resolve ( resolveParams )
8786 . then ( ( doc ) => {
8887 // $FlowFixMe
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ export default function removeMany(
5959 ...( opts && opts . filter ) ,
6060 } ) ,
6161 } ,
62+ // $FlowFixMe
6263 resolve : ( resolveParams : ExtendedResolveParams ) => {
6364 const filterData = ( resolveParams . args && resolveParams . args . filter ) || { } ;
6465
@@ -72,15 +73,20 @@ export default function removeMany(
7273 }
7374
7475 resolveParams . query = model . find ( ) ;
76+ // $FlowFixMe
7577 filterHelper ( resolveParams ) ;
7678 resolveParams . query = resolveParams . query . remove ( ) ;
7779
7880 return (
81+ // `beforeQuery` is experemental feature, if you want to use it
82+ // please open an issue with your use case, cause I suppose that
83+ // this option is excessive
84+ // $FlowFixMe
7985 resolveParams . beforeQuery
80- ? Promise . resolve ( resolveParams . beforeQuery ( resolveParams . query ) )
86+ ? Promise . resolve ( resolveParams . beforeQuery ( resolveParams . query , resolveParams ) )
8187 : resolveParams . query . exec ( )
8288 )
83- . then ( res => {
89+ . then ( ( res ) => {
8490 if ( res . result && res . result . ok ) {
8591 return {
8692 numAffected : res . result . n ,
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ export default function updateMany(
7575 ...( opts && opts . limit ) ,
7676 } ) ,
7777 } ,
78+ // $FlowFixMe
7879 resolve : ( resolveParams : ExtendedResolveParams ) => {
7980 const recordData = ( resolveParams . args && resolveParams . args . record ) || { } ;
8081
@@ -88,17 +89,25 @@ export default function updateMany(
8889 }
8990
9091 resolveParams . query = model . find ( ) ;
92+ // $FlowFixMe
9193 filterHelper ( resolveParams ) ;
94+ // $FlowFixMe
9295 skipHelper ( resolveParams ) ;
96+ // $FlowFixMe
9397 sortHelper ( resolveParams ) ;
98+ // $FlowFixMe
9499 limitHelper ( resolveParams ) ;
95100
96101 resolveParams . query = resolveParams . query . setOptions ( { multi : true } ) ; // eslint-disable-line
97102 resolveParams . query . update ( { $set : toDottedObject ( recordData ) } ) ;
98103
99104 return (
105+ // `beforeQuery` is experemental feature, if you want to use it
106+ // please open an issue with your use case, cause I suppose that
107+ // this option is excessive
108+ // $FlowFixMe
100109 resolveParams . beforeQuery
101- ? Promise . resolve ( resolveParams . beforeQuery ( resolveParams . query ) )
110+ ? Promise . resolve ( resolveParams . beforeQuery ( resolveParams . query , resolveParams ) )
102111 : resolveParams . query . exec ( )
103112 )
104113 . then ( ( res ) => {
You can’t perform that action at this time.
0 commit comments