Macro Attributes
#[rpc_query] and #[rpc_mutation] accept optional attributes that control caching, initialization, timeouts,
and retry behavior.
| Attribute | #[rpc_query] | #[rpc_mutation] | Description |
|---|---|---|---|
| cache | yes | no | Cache-Control headers on responses |
| stale | yes (requires cache) | no | stale-while-revalidate |
| init | yes | yes | Cold-start initialization + shared state |
| timeout | yes | yes | Server-side timeout (504 on exceed) |
| idempotent | no | yes | Opt mutation into retry |