graphql-python / graphql-python/graphql-core

When enum is used as argument, its default value is not validated against enum definition

未关闭
#122 2 条评论 1 个 reaction 已指派 1 人 已被 @Cito 认领 在 GitHub 查看
pending upstream
主要语言
Python
星标
531
派生
146
PR 合并指标
30 天内没有已合并 PR

描述

Hello!

While working on enum support in Ariadne I've found that enums values aren't validated against GraphQL enum when they are defined as fields on GraphQL schema.

Following schema passes validation:

```graphql
enum Role {
ADMIN
USER
}

type Query {
hello(r: Role = ADMIN): String
complex(i: Test = { role: INVALID }): String
complexAlt(i: Test): String
}

input Test {
ignore: String
role: Role = INVALID
}
```

I would've expected schema validators to raise `INVALID`, but instead those fields are quietly excluded from default value passed to field's resolver.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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