Skip to main content
Version: 4.x.x

Query Params Type

Query Params are very often untyped, which may cause maintenance problems. However, this is not the case here, and our query params types can be easily added to the request.


Example

type QueryParamsType = {
search?: string;
role?: "Admin" | "User";
};

const getUsers = client.createRequest<ResponseType, null, null, QueryParamsType>()({
endpoint: "/users",
});