99designs / 99designs/gqlgen

how to limit the amount of the alias

Đang mở
#2,496 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
10.8k
Fork
1.3k
Merge trung bình
2 ngày 36 phút
Pull request đã merge (30 ngày)
26

Mô tả

### What happened?
I can't limit the amount of the alias. FixedComplexityLimit limits the complexity of the query.

### What did you expect?
I want to limit the amount of the alias to prevent the batching attack. Let's try to explain by giving an example.

```
query {
productsByIds(productIds: "353573855") {
active {
id
path
title
}
productsByIds2: productsByIds(productIds: "353573855") {
active {
id
path
title
}
}

```

The above query should give an error. However, the below should work. This is just an example I have more complex schemas that's why the complexity limit didn't work for me.

```
query {
productsByIds(productIds: "353573855") {
active {
id
path
title
}
products {
active {
id
path
title
}
}
}
```
### Minimal graphql.schema and models to reproduce

### versions
- `go run github.com/99designs/gqlgen version` v0.17.22
- `go version` 1.19

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

Mở hướng dẫn đóng góp

Đá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.