diff options
Diffstat (limited to 'doc/development/graphql_guide/batchloader.md')
-rw-r--r-- | doc/development/graphql_guide/batchloader.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/development/graphql_guide/batchloader.md b/doc/development/graphql_guide/batchloader.md index 6a716de61b8..5f06f1faf1e 100644 --- a/doc/development/graphql_guide/batchloader.md +++ b/doc/development/graphql_guide/batchloader.md @@ -41,8 +41,8 @@ class UserResolver < BaseResolver end ``` -- `project_id` is the `ID` of the current project being queried -- `loader.call` is used to map the result back to the input key (here a project ID) +- `username` is the username we want to query. It can be one name or multiple names. +- `loader.call` is used to map the result back to the input key (here user is mapped to its username) - `BatchLoader::GraphQL` returns a lazy object (suspended promise to fetch the data) Here an [example MR](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46549) illustrating how to use our `BatchLoading` mechanism. @@ -161,7 +161,7 @@ you do so, you do not need to manage the lifecycle of lazy values yourself, and you are assured accurate results. GraphQL fields that return lazy values may need these values forced in tests. -Forcing refers to explicit demands for evaluation, where this would normally +Forcing refers to explicit demands for evaluation, where this would usually be arranged by the framework. You can force a lazy value with the `GraphqlHelpers#batch_sync` method available in [GraphQLHelpers](https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/support/helpers/graphql_helpers.rb), or by using `Gitlab::Graphql::Lazy.force`. For example: |