Skip to content

@BatchMapping methods should pass the localContext as the BatchLoaderEnvironment's keyContexts #1071

New issue

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

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

Already on GitHub? # to your account

Closed
github-actions bot opened this issue Oct 17, 2024 · 1 comment
Assignees
Labels
in: core Issues related to config and core support type: backport type: enhancement A general enhancement
Milestone

Comments

@github-actions
Copy link
Contributor

Backport of gh-1066

@github-actions github-actions bot added in: core Issues related to config and core support type: backport type: bug A general bug labels Oct 17, 2024
@github-actions github-actions bot added this to the 1.2.9 milestone Oct 17, 2024
bclozel added a commit that referenced this issue Oct 17, 2024
Prior to this commit, `@BatchMapping` controller methods would be
automatically registered as date fetchers delegating to data loader
calls. Those calls would not include the current local context or main
context. As a result, injecting the `BatchLoaderEnvironment` in the
controller method signature would not contain the `getKeyContext()`.

This commit ensures that dataloader calls not only use the current
source, but also the current local context/main context so that it will
be present in the key contexts map.

Fixes gh-1071
Copy link
Contributor Author

Fixed via 6849d3b

@bclozel bclozel self-assigned this Oct 17, 2024
@rstoyanchev rstoyanchev changed the title @BatchMapping methods do not propagate GraphQL context to DataLoader @BatchMapping methods should pass the localContext as the BatchLoaderEnvironment's keyContexts Oct 21, 2024
@rstoyanchev rstoyanchev added type: enhancement A general enhancement and removed type: bug A general bug labels Oct 21, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
in: core Issues related to config and core support type: backport type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants