4 releases (2 stable)

1.0.1 Jan 15, 2024
1.0.0 Oct 28, 2023
0.1.1 Mar 21, 2023
0.1.0 Feb 19, 2023

#339 in Procedural macros

Download history 10/week @ 2024-01-29 98/week @ 2024-02-26 2/week @ 2024-03-04 15/week @ 2024-03-11 7/week @ 2024-03-25 19/week @ 2024-04-01 1/week @ 2024-04-08 5/week @ 2024-04-15 13/week @ 2024-04-22 84/week @ 2024-04-29 10/week @ 2024-05-06

112 downloads per month
Used in create-rust-app_cli

MIT/Apache

43KB
1K SLoC

Generated reat-query hooks for your services in actix-web, poem, axum, you-name-it.

Makes many assumptions!

  • Works with a particular version of react-query (last tested on: "react-query": "^3.39.3")
  • Endpoints return JSON (i.e. fetch(..).json() should work)
  • Directory structure determines API paths!
  • Just use #[qsync] above your method names.
  • You can also specify a typescript return type like #[qsync(return_type="string[]")] or whether it's a mutation or not (#[qsync(mutate)]).
  • When using a web framework like actix_web, make sure to declare the qsync attribute above above #[get("..")] or similar attributes which denote the endpoint's method and path. Rust evaluates macros from outer-most to the inner-most which means order is important!

See https://github.com/Wulf/create-rust-app.

Dependencies

~4–12MB
~139K SLoC