web: rewrite frontend to use graphql for search results
This commit is contained in:
@@ -15,14 +15,14 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
||||
)]
|
||||
pub struct FrontPageQuery;
|
||||
|
||||
async fn send_graphql<Body, Resp>(body: Body) -> fetch::Result<graphql_client::Response<Resp>>
|
||||
pub async fn send_graphql<Body, Resp>(body: Body) -> fetch::Result<graphql_client::Response<Resp>>
|
||||
where
|
||||
Body: Serialize,
|
||||
Resp: DeserializeOwned + 'static,
|
||||
{
|
||||
use web_sys::RequestMode;
|
||||
|
||||
Request::new("/graphql")
|
||||
Request::new("/graphql/")
|
||||
.method(Method::Post)
|
||||
.header(Header::content_type("application/json"))
|
||||
.mode(RequestMode::Cors)
|
||||
|
||||
Reference in New Issue
Block a user