99designs / 99designs/gqlgen

how to limit the amount of the alias

オープン
#2,496 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
10.8k
フォーク
1.3k
平均マージ
2日 36分
マージ済み PR(30日)
26

説明

### 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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。