Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feat: Better handle multiple queries

Đã đóng
#2,121 0 bình luận 2 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
nextjs, react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Start with the discussion in #2110 and inspect the existing useFaustQuery and FaustProvider paths described in the issue. Compare the proposed useSeedQuery and useQuery approaches, then define a solution that supports the same query with different variables, avoids duplicate caching, preserves existing behavior, and documents multiple-query usage.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

[Area] Core [Type] Enhancement Needs Discussion

We should come up with a better solution to handle multiple queries in Faustjs. Discussion around useFaustQuery and multiple queries: #2110

Summary:
  • useFaustQuery adds an elegant way to access multiple queries on client side.

    • But it don't support to get the same queries with different variables.
    • It's also adding a duplicate cache, where we already have the same data in Apollo cache.
  • We can use Apollo's useQuery to access server-fetched data with more control.

    • To do this we need to have the correct query variables that server uses to fetch data, mostly based on seed query.
    • Template passes seed query data inside props. But it's not a developer friendly way to access that data, also requires prop drilling for child components.
Next steps:
  • A better way to access the data on client side should be explored.

    • One option is to have useSeedQuery utility to access the seed node anywhere under FaustProvider.
    • Another way is to wrap useQuery with useFaustQuery without restricting the capabilities of useQuery.
  • We should avoid breaking changes.

  • We may consider a config option to disable useFaustQuery-related cache for those who want it.

  • We should well document the capabilities of Faust for the multiple queries.

Ngôn ngữ chính
TypeScript
Star
1.6k
Fork
157
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
101

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wpengine/faustjs

Tất cả issue của wpengine/faustjs

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.