Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

feat: Better handle multiple queries

Chiusa
#2,121 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
nextjs, react, typescript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

[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.

Lingua principale
TypeScript
Stelle
1.6k
Fork
157
Merge medio
1g 6h
PR unite (30g)
101

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di wpengine/faustjs

Tutte le issue di wpengine/faustjs

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.