Skip to main content

Overview

useFetchCommentByForeignId returns a function that fetches a comment using the foreign ID from your own system. Useful when you’ve stored your own identifier on a comment and need to retrieve it later.
If the comment author is block-edged with the signed-in caller, in either direction, this returns 404 with comment/not-found — identical to a comment that does not exist. An embedded parentComment is nulled under the same rule. Requires the moderation bundle.

Usage Example

Parameters

string
required
The foreign ID to look up.
string | string[]
Populate related data. Accepted values: "user", "entity", "space", "parent", "grants".

Returns

Comment
The fetched comment. See Comment data model.