Skip to content

Commit 3a26d60

Browse files
Update src/pages/learn/file-uploads.mdx
Co-authored-by: Benjie <[email protected]>
1 parent 39768a0 commit 3a26d60

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/learn/file-uploads.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ A safe practice is to use trusted documents or a validation rule to ensure each
3434
GraphQL executes in phases: validation, then execution. If validation fails or an authorization check blocks execution, uploaded
3535
file streams may never be consumed. If your server buffers or retains these streams, it can cause memory leaks.
3636

37-
To avoid this, consider writing incoming files to temporary storage immediately, and passing references (like filenames) into
37+
To avoid this, ensure that all streams are terminated when the request finishes, whether or not they were consumed in resolvers.
38+
An alternative to consider is writing incoming files to temporary storage immediately, and passing references (like filenames) into
3839
resolvers. Ensure this storage is cleaned up after request completion, regardless of success or failure.
3940

4041
### Cross-Site Request Forgery (CSRF)

0 commit comments

Comments
 (0)