Support Locale as a controller method argument

Closes gh-3
This commit is contained in:
Rossen Stoyanchev
2021-11-01 10:35:44 +00:00
parent 2c8638dd6a
commit 4dcb9ea7c6
4 changed files with 135 additions and 30 deletions

View File

@@ -593,15 +593,15 @@ See <<controllers-schema-mapping-data-loader>>.
| `GraphQLContext`
| For access to the context from the `DataFetchingEnvironment`.
See <<controllers-schema-mapping-graphql-context>>.
| `DataFetchingFieldSelectionSet`
| For access to the selection set for the query through the `DataFetchingEnvironment`.
See <<controllers-schema-mapping-selection-set>>.
| `Locale`, `Optional<Locale>`
| For access to the `Locale` from the `DataFetchingEnvironment`.
| `DataFetchingEnvironment`
| For direct access to the underlying `DataFetchingEnvironment`.
See <<controllers-schema-mapping-environment>>.
|===
@@ -721,28 +721,6 @@ instead.
====
[[controllers-schema-mapping-graphql-context]]
==== `GraphQLContext`
To access the `GraphQLContext` from the `DataFetchingEnvironment`, declare a method
parameter of the same type.
[[controllers-schema-mapping-selection-set]]
==== `DataFetchingFieldSelectionSet`
To access the `DataFetchingFieldSelectionSet` from the `DataFetchingEnvironment`, declare
a method parameter of the same type. This is useful to peek ahead at the fields that need
to be fetched.
[[controllers-schema-mapping-environment]]
==== `DataFetchingEnvironment`
To access the `DataFetchingEnvironment` directly, declare a method parameter of the same
type.
[[controllers-batch-mapping]]
=== `@BatchMapping`