From 3dabbf8b2319fefe3462c826fa9a7f5cde1a9d7e Mon Sep 17 00:00:00 2001
From: Michael Kozono <mkozono@gitlab.com>
Date: Thu, 4 Jul 2024 07:03:40 +0000
Subject: [PATCH] Document that #sync is generally fine in mutations

---
 doc/development/graphql_guide/batchloader.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/development/graphql_guide/batchloader.md b/doc/development/graphql_guide/batchloader.md
index a4295cb3214ed..797c81a869566 100644
--- a/doc/development/graphql_guide/batchloader.md
+++ b/doc/development/graphql_guide/batchloader.md
@@ -154,6 +154,8 @@ def catalog_url
 end
 ```
 
+We commonly use `#sync` in a mutation after finding a record with `GitlabSchema.find_by_gid` or `.object_from_id`, as those methods return the result in a batch loader wrapper. Mutations are executed serially, so batch loading is not necessary and the object can be evaluated immediately.
+
 ## Testing
 
 Ideally, do all your testing using request specs, and using `Schema.execute`. If
-- 
GitLab