graphql-python / graphql-python/graphql-core-legacy
Order of Middlewares
- Vorherrschende Sprache
- Python
- Sterne
- 372
- Forks
- 175
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.