Generate export query.client functions
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react, typescript
- Lĩnh vực
- developer-experience, tooling
Hướng nghiên cứu
Start with the generated query.client output and the existing useHook generation path; the issue names no repository files or tests. Compare the generated API with the React Router loader examples using queryClient.fetchQuery. Done means code generation exposes query keys and query functions for direct loader use without hooks.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi, i try to find a way using the generated query.client types and functions directly without any useHook implementation, so i can use the react-router v6 way of loading data before rendering any component.
there for it is needed to write the router like mentioned in the example as it will handle the data loading in "loaders" before react lifecycle is used. (cannot use useHooks and needs to use the queryclient directly)
https://reactrouter.com/en/main/guides/data-libs#loading-data
import { queryClient } from "./query-client";
export const loader = ({ params }) => {
return queryClient.fetchQuery(queryKey, queryFn, {
staleTime: 10000,
});
};
or more specific example of a loader:
export const loader =
(queryClient) =>
async ({ request }) => {
const url = new URL(request.url);
const q = url.searchParams.get("q");
if (!queryClient.getQueryData(contactListQuery(q).queryKey)) {
await queryClient.fetchQuery(contactListQuery(q));
}
return { q };
};
Is there any way getting the queries with queryKey and queryFn from the codegen?
thx in advance
- Ngôn ngữ chính
- TypeScript
- Star
- 635
- Fork
- 82
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fabien0102/openapi-codegen
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fabien0102/openapi-codegen#343 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fabien0102/openapi-codegen#342 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
fabien0102/openapi-codegen#356 ·
-
update dependencies & removed unused deprecatedCó thể đã có người làm @el-j đã nhận 12 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
fabien0102/openapi-codegen#354 ·
-
deepMerge mutates its arguments, corrupting request payloads across callsCó thể đã có người làm @richard-willis-chevin đã nhận 56 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
fabien0102/openapi-codegen#349 ·
Tất cả issue của fabien0102/openapi-codegen
Issue tương tự
-
area: aria/combobox gemini-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
angular/components#33973 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug priority: P2
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[bug] status, list and push crash with an uncaught NotInitializedError stack trace when teamai is not initializedCó thể đã có người làm @jay23606 đã nhận hôm nay. Đang mởbug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Tencent/teamai-cli#1227 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Tool]: YapĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 62/100
withkarann/aifoxx#417 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
sindresorhus/eslint-plugin-unicorn#3921 ·
Maintainer thường phản hồi trong vòng 1 ngày