Add @LocalContextValue and resolver

@ContextValue checks in the main context.
@LocalContextValue checks in the local context.

Closes gh-353
This commit is contained in:
rstoyanchev
2022-05-06 07:14:06 +01:00
parent 07293abf35
commit 5b59e51bab
9 changed files with 272 additions and 70 deletions

View File

@@ -1202,8 +1202,10 @@ See <<controllers-schema-mapping-source>>.
See <<controllers-schema-mapping-data-loader>>.
| `@ContextValue`
| For access to a value from the localContext, if it is an instance of `GraphQLContext`,
or from the `GraphQLContext` of `DataFetchingEnvironment`.
| For access to an attribute from the main `GraphQLContext` in `DataFetchingEnvironment`.
| `@LocalContextValue`
| For access to an attribute from the local `GraphQLContext` in `DataFetchingEnvironment`.
| `GraphQLContext`
| For access to the context from the `DataFetchingEnvironment`.