Skip to main content

Function: useEprintChangelogs()

useEprintChangelogs(eprintUri, options): UseQueryResult<EprintChangelogsResponse, APIError>

Defined in: web/lib/hooks/use-eprint-mutations.ts:434

Fetches paginated changelogs for an eprint.

Parameters

eprintUri

string

AT Protocol URI of the eprint to fetch changelogs for

options

UseEprintChangelogsOptions = {}

Query options including pagination parameters

Returns

UseQueryResult<EprintChangelogsResponse, APIError>

Query result with changelog list, loading state, and error

Remarks

Uses TanStack Query with a 5-minute stale time to balance freshness with cache efficiency. Changelogs are immutable once created, so aggressive caching is appropriate.

Example

const { data, isLoading, error, fetchNextPage, hasNextPage } = useEprintChangelogs(
'at://did:plc:abc/pub.chive.eprint.submission/123',
{ limit: 10 }
);

if (isLoading) return <ChangelogSkeleton />;
if (error) return <ChangelogError error={error} />;

return (
<ChangelogList
changelogs={data?.changelogs ?? []}
hasMore={data?.hasMore ?? false}
onLoadMore={fetchNextPage}
/>
);