qsync

Crates.ioqsync
lib.rsqsync
version1.0.1
sourcesrc
created_at2023-02-19 00:47:55.04046
updated_at2024-01-15 23:47:29.148111
descriptionGenerate react-query hooks for your rust backend (see https://github.com/Wulf/create-rust-app)
homepage
repository
max_upload_size
id788570
size41,859
Haris (Wulf)

documentation

README

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.

Commit count: 0

cargo fmt