Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resolver.resolveAsync and multiArgs #315

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

loynoir
Copy link

@loynoir loynoir commented Oct 29, 2021

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 29, 2021

CLA Signed

The committers are authorized under a signed CLA.

*/
resolveSync(context, path, request) {
resolveSync(context, path, request, resolveContext, multiArgs) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need multiArgs?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexander-akait

  1. Callback wrapper, like bluebird, wrap callback base api into promise api, optionally accept multiArgs.
Promise.promisify(
    function(any arguments..., function callback) nodeFunction,
    [Object {
        multiArgs: boolean=false,
        context: any=this
    } options]
) -> function

So, I think wrap a callback to .resolveAsync accept multiArgs should be better.

  1. Because of opinion 1, for api compact, I think .resolveSync accept Parameters<Resolver['resolveAsync']>, and return Awaited<ReturnType<Resolver['resolveAsync']>>. So, I think wrap a callback to .resolveSync should accept multiArgs.
  2. Also resolveRequest contains meta like .descriptionFileData, useful for further sideEffects or else meta parsing

@alexander-akait
Copy link
Member

@loynoir Sorry for delay, can you rebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants