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

Order of Middlewares

Open
#155 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
372
Forks
175
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.