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

Question about this-application #1

Open
SillyFreak opened this issue Jun 7, 2020 · 0 comments
Open

Question about this-application #1

SillyFreak opened this issue Jun 7, 2020 · 0 comments

Comments

@SillyFreak
Copy link

Hi, I have a question regarding your use of resolve.apply, e.g. here:

field.resolve = async function(...args) {
  // ....
  await this.executeStrategy(requiredRole, requestData);

  return resolve.apply(this, args);
}.bind(this);

You're binding this to be the ..AuthDirective instance, allowing you to call executeStrategy for example. However, then you call resolve.apply(this, args); it would seem logical to me that this should be resolve.apply(field, args).

Is this an error, or am I missing the purpose of the this here?

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

No branches or pull requests

1 participant