the following typescript code:
function rule(name?: string, options?: IRuleOptions)(func: IRuleFunction): Rule
export type IRuleFunction = (
parent?: any,
args?: any,
context?: any,
info?: GraphQLResolveInfo,
) => IRuleResult | Promise<IRuleResult>
interface IRuleOptions {
cache?: ICacheOptions
fragment?: IFragment
}
question:
the first line of code is as follows:
function rule(name?: string, options?: IRuleOptions)(func: IRuleFunction): Rule
------------------------------------- ------------------- ----
1 2 3
(1) is an argument to the function and can be understood. What do
(2) and (3) mean?
Please give me some guidance, thank you
Update:
Code Source: https://github.com/maticzav/g.