Commit 6849d3b
committed
Propagate context to Dataloader in
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@BatchMapping
1 parent b8b93a0 commit 6849d3b
File tree
2 files changed
+45
-3
lines changed- spring-graphql/src
- main/java/org/springframework/graphql/data/method/annotation/support
- test/java/org/springframework/graphql/data/method/annotation/support
2 files changed
+45
-3
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
758 | | - | |
| 758 | + | |
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
| |||
Lines changed: 44 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| |||
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
129 | 153 | | |
130 | 154 | | |
131 | 155 | | |
132 | 156 | | |
133 | 157 | | |
134 | | - | |
| 158 | + | |
135 | 159 | | |
136 | 160 | | |
137 | 161 | | |
| |||
203 | 227 | | |
204 | 228 | | |
205 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
206 | 248 | | |
207 | 249 | | |
0 commit comments