graphql-python / graphql-python/graphql-core

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

Đang mở
#122 2 bình luận 1 reaction 1 người được giao Được @Cito nhận Xem trên GitHub
pending upstream
Ngôn ngữ chính
Python
Star
531
Fork
146
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.