Title
Add TanStack Query v5 generation to TypeGen
Summary
Add first-class TanStack Query v5 client generation to ZibStack.NET.TypeGen.
This would introduce TypeTarget.TanStackQuery and fluent TanStackQuerySettings, allowing TypeGen to emit typed TanStack Query client code from the discovered endpoint model.
Generated output should include fetch functions, query keys, queryOptions, mutationOptions, React hooks, prefetch helpers, and invalidation helpers.
TypeGen should also read Minimal API .WithName(...) and .WithTags(...) metadata so operation names and query-key groups can be controlled through normal Minimal API conventions.
Motivation
Some team members have asked whether Zib can support generated TanStack Query clients.
This would reduce repeated frontend boilerplate in React apps by generating the query keys, fetch wrappers, hooks, and cache helpers directly from the .NET API shape while preserving type safety.
Example
app.MapGet("/users/{id}", GetUserById)
.WithName("GetUserById")
.WithTags("Users");
Could generate:
export const usersKeys = {
detail: (id: string) => ['Users', 'GetUserById', id] as const,
};
export function useGetUserByIdQuery(id: string) {
return useQuery({
queryKey: usersKeys.detail(id),
queryFn: () => getUserById(id),
});
}
Title
Add TanStack Query v5 generation to TypeGen
Summary
Add first-class TanStack Query v5 client generation to
ZibStack.NET.TypeGen.This would introduce
TypeTarget.TanStackQueryand fluentTanStackQuerySettings, allowing TypeGen to emit typed TanStack Query client code from the discovered endpoint model.Generated output should include fetch functions, query keys,
queryOptions,mutationOptions, React hooks, prefetch helpers, and invalidation helpers.TypeGen should also read Minimal API
.WithName(...)and.WithTags(...)metadata so operation names and query-key groups can be controlled through normal Minimal API conventions.Motivation
Some team members have asked whether Zib can support generated TanStack Query clients.
This would reduce repeated frontend boilerplate in React apps by generating the query keys, fetch wrappers, hooks, and cache helpers directly from the .NET API shape while preserving type safety.
Example
Could generate: