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

Execute: Remove excessive arguments #1268

Merged
merged 1 commit into from
Mar 29, 2018

Conversation

IvanGoncharov
Copy link
Member

Using benchmark, I didn't measure any performance difference.

Copy link
Contributor

@leebyron leebyron left a comment

Choose a reason for hiding this comment

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

Let's just avoid keying into the opaque info object provided for resolvers

fieldNodes[0],
exeContext.variableValues,
info.fieldNodes[0],
info.variableValues,
Copy link
Contributor

Choose a reason for hiding this comment

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

Info should be opaque to the executor internals - it's only used to pass into resolvers. These two should be either passed in directly as arguments or pulled from exeContext

if (isPromise(completed)) {
return completed.then(undefined, error =>
Promise.reject(
locatedError(
asErrorInstance(error),
fieldNodes,
info.fieldNodes,
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly here - the fieldNodes value is an important argument to the completeValue functions - it should be passed directly instead of extracted from the info passed to resolvers

@IvanGoncharov
Copy link
Member Author

@leebyron I removed all changes that used data from the info.
Can you please take a look?

@leebyron leebyron merged commit 4dfb993 into graphql:master Mar 29, 2018
@leebyron
Copy link
Contributor

Great!

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.

3 participants