Pass localContext only if available

See gh-1066
This commit is contained in:
rstoyanchev
2024-10-21 18:21:03 +01:00
parent 58cce019ed
commit 88d7ea7894
4 changed files with 30 additions and 5 deletions

View File

@@ -743,7 +743,15 @@ Batch mapping methods support the following arguments:
| `BatchLoaderEnvironment`
| The environment that is available in GraphQL Java to a
`org.dataloader.BatchLoaderWithContext`.
`org.dataloader.BatchLoaderWithContext`.
The `context` property of `BatchLoaderEnvironment` returns the same
`GraphQLContext` instance that is also available to `@SchemaMapping`
methods through the `DataFetchingEnvironment`.
The `keyContexts` property of `BatchLoaderEnvironment` returns the
localContext obtained from the `DataFetchingEnvironment` when the
`DataLoader` was called for each key.
|===