File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,16 @@ import * as merge from "deepmerge";
44export const combineResolvers = ( resolvers = [ ] ) => resolvers
55 . reduce ( ( combined , resolver ) => merge ( combined , resolver ) ) ;
66
7+ // Accepts multiple authentication resolvers and returns a function which will be called
8+ // if all of the authentication resolvers succeed, or throw an error if one of them fails
79export const and = ( ...conditions ) => resolver => {
810 return conditions . reduceRight ( ( p , c ) => {
911 return c . createResolver ( p ) ;
1012 } , resolver )
1113}
1214
15+ // Accepts multiple authentication resolvers and returns a function which will be called
16+ // if any of the authentication resolvers succeed, or throw an error if all of them fail
1317export const or = ( ...conditions ) => resolver => ( ...query ) => {
1418 return new Promise ( ( resolve , reject ) => {
1519 let limit = conditions . length - 1 ;
You can’t perform that action at this time.
0 commit comments