diff --git a/packages/blog/src/ui/query.ts b/packages/blog/src/ui/query.ts new file mode 100644 index 0000000..85c46b7 --- /dev/null +++ b/packages/blog/src/ui/query.ts @@ -0,0 +1,29 @@ +// React Query option builders for blog feature procedures. +// Consumed by apps via the @repo/core-trpc client (wired in Plan 5). + +type TrpcClient = { + blog: { + articleBySlug: { + queryOptions: (input: { slug: string }) => unknown; + }; + listArticles: { + queryOptions: (input?: { + status?: string; + authorId?: string; + limit?: number; + offset?: number; + }) => unknown; + }; + }; +}; + +export function articleBySlugQuery(client: TrpcClient, slug: string) { + return client.blog.articleBySlug.queryOptions({ slug }); +} + +export function listArticlesQuery( + client: TrpcClient, + options?: { status?: string; authorId?: string; limit?: number; offset?: number }, +) { + return client.blog.listArticles.queryOptions(options); +}