Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add support for custom validators in default GraphQL backend

未关闭
#267 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@JoaRiski 已经在做这个了。

开始于 2020年2月25日。

  • #268 来自 @JoaRiski —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
graphql, python
领域
api, backend

调研方向

首先定位默认 GraphQL 后端的验证和执行路径,然后将其与 issue 所引用的 graphql/validation/rules/init.py 中的验证器列表进行比较。当自定义验证器能够在无需重新实现验证和执行的情况下扩展默认后端时,这项工作就完成了。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
371
派生
174
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

graphql-python/graphql-core-legacy 的其他 Issue

查看 graphql-python/graphql-core-legacy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。