Fix object-list filter preflight plan traversal and argument identification

Aperta
#613 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
fsharp, graphql

Direzione di ricerca

Inizia con il preflight della richiesta di filtro ObjectListFilter e l’attraversamento del piano eseguibile, quindi esamina la discussione della pull request collegata per il contesto. Traccia i piani di collection differiti, trasmessi, live e annidati e verifica la gestione dello stato di inclusione e l’identificazione dell’argomento nullable ObjectListFilter aggiunto dal middleware. Il lavoro è completato quando i filtri avvolti e annidati vengono sottoposti a coercizione, mentre gli argomenti di filtro esclusi o non correlati vengono accettati.

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

Descrizione

Description

The object-list filter request preflight does not accurately follow the executable plan and can both miss invalid filters and reject valid requests.

The preflight should traverse deferred, streamed, live, and nested collection plans while only coercing the nullable ObjectListFilter argument added by the object-list filter middleware.

Source: https://github.com/fsprojects/FSharp.Data.GraphQL/pull/612#pullrequestreview-5253463363

Repro steps
  1. Execute a query where an object-list filter is inside an @defer, @stream, or @live wrapper, or inside a nested collection element plan.

  2. Observe that request-level filter coercion can be bypassed.

  3. Execute a query containing an excluded subtree or an unrelated field with an argument such as filter: String.

  4. Observe that the preflight can treat that argument as the middleware's object-list filter and reject an otherwise valid request.

Expected behavior

The preflight should:

  • traverse @defer, @stream, and @live wrappers transparently;
  • traverse collection element plans and nested filtered fields;
  • skip nodes excluded by execution directives;
  • coerce only fields whose definition contains the middleware-added nullable ObjectListFilter argument.
Actual behavior

The traversal stops at wrappers and collection element plans, allowing wrapped or nested list filters to bypass request-level coercion. It also ignores inclusion state and identifies arguments by the name filter, which can incorrectly reject excluded subtrees or unrelated filter arguments.

Known workarounds

Avoid wrapping or nesting object-list-filtered fields and avoid unrelated arguments named filter. These are not practical general-purpose workarounds.

Related information
  • Operating system: All
  • Branch: dev / observed while reviewing task-seq-field-streaming-fixes
  • .NET Runtime, CoreCLR or Mono Version: .NET 10
  • Performance information, links to performance testing scripts: N/A
Lingua principale
F#
Stelle
406
Fork
74
Merge medio
1g 8h
PR unite (30g)
14

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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 fsprojects/FSharp.Data.GraphQL

Tutte le issue di fsprojects/FSharp.Data.GraphQL

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.