graphql-python / graphql-python/graphql-core-legacy
Add support for custom validators in default GraphQL backend
- Vorherrschende Sprache
- Python
- Sterne
- 372
- Forks
- 175
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
The default GraphQL backend seems to perform validation prior to execution of a query. The validators that are being run are statically defined in https://github.com/graphql-python/graphql-core/blob/fe703f0d176c78b205d2abf929193f1e910fe4a0/graphql/validation/rules/__init__.py#L32-L57 and there doesn't seem to be a very good way to add custom validators to this list.
It would be nice to be able to extend the default GraphQL backend with your own validators, e.g. by having a overridable function called `get_validators` in the backend class that's used for getting the validators.
Right now the only option (as far as I'm aware) seems to be to completely re-implement the execution and validation logic if you don't want to monkeypatch the validators list.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne damit, den Validierungs- und Ausführungspfad des standardmäßigen GraphQL-Backends zu ermitteln, und vergleiche ihn anschließend mit der in der Issue referenzierten Validatorliste in graphql/validation/rules/__init__.py. Die Arbeit ist abgeschlossen, wenn benutzerdefinierte Validatoren das standardmäßige Backend erweitern können, ohne Validierung und Ausführung neu zu implementieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- graphql, python
- Bereich
- api, backend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100