AshTypescript.Rpc.Codegen.FunctionGenerators.TypedQueries (ash_typescript v0.18.1)

Copy Markdown View Source

Generates TypeScript typed query types and field constants.

Typed queries provide compile-time type safety for server-side rendered data and allow the same field selections to be used for client-side refetching.

Summary

Functions

generate_typed_queries_section(typed_queries, rpc_resources_and_actions, all_resources)

Generates the typed queries section for TypeScript output.

Returns an empty string if no typed queries are defined.

generate_typed_query_type_and_const(resource, action, typed_query, rpc_resources_and_actions, all_resources)

Generates a single typed query type and const declaration.