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 摘要。