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

Order of Middlewares

Abierto
#155 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
372
Forks
175
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start at graphql/execution/middleware.py#L51 and reproduce the call order with schema.execute using the middleware=[mw1, mw2] example. Check the existing execution tests for middleware coverage; done means the intended ordering is settled and captured in a regression test or documentation.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
graphql, python
Área
api, backend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.