graphql-python / graphql-python/graphql-core-legacy

Order of Middlewares

Aperta
#155 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
372
Fork
175
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I've discovered that this line inverts the middleware order:
https://github.com/graphql-python/graphql-core/blob/6df8a6312b579a6a1454bcf29a566ce5d0fa9849/graphql/execution/middleware.py#L51

This was somewhat confusing, as I expected the first installed middleware to be the entrypoint. I.e.

```python
schema.execute(
statement,
middleware=[mw1, mw2],
)
```

actually produces the call stack `mw2 -> mw1 -> resolve_func`, whereas i'd expected `mw1 -> mw2 -> resolve_func`.

I'm not clear if this is a bug, as this functionality isn't tested anywhere, or if it would just go in documentation somewhere.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.