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

Pass resolution to dataloader helper's callback #1211

Conversation

antonsatin
Copy link
Contributor

Resolves #1192

Hi folks 👋🏻

This PR adds support for getting resolution inside a callback function that's passed to dataloader helper. Basically it allows to pass callback/4 instead of callback/3 to dataloader options, in that case last argument will be resolution struct.

The do_dataloader function becomes a bit thick with its arguments list, but using opts or changing it completely didn't seem like a good option to me either.

Allows to get resolution structure from dataloader callback function.

Adds support for callback with arity 4, in that case last argument
will be resolution struct.
Copy link
Contributor

@benwilson512 benwilson512 left a comment

Choose a reason for hiding this comment

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

This looks great, thank you!

@benwilson512 benwilson512 merged commit 2e42948 into absinthe-graphql:master Dec 4, 2022
@antonsatin antonsatin deleted the feature/support-resolution-in-dataloader-callback branch December 5, 2022 08:44
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

Successfully merging this pull request may close these issues.

[Feature suggestion] Pass context to the callback function of Absinthe.Resolution.Helpers.dataloader/2 options
2 participants