Azure / Azure/data-api-builder
[Bug]: GraphQL pagination with order by statements omits values
- 主要言語
- C#
- スター
- 1.5k
- フォーク
- 370
- 平均マージ
- 3日 22時間
- マージ済み PR(30日)
- 9
説明
### What happened?
We've noticed a potential issue with the SQL generation within the Data API Builder, specifically when handling GraphQL queries that include pagination and sorting. The SQL output appears to introduce unintended predicates affecting the sorting column. These predicates seem to cause records with null values in the sorting column to be excluded from the results, varying with the sort order (ascending showing null values and with descending excluding null values).
### Version
1.1.7
### What database are you using?
Azure SQL
### What hosting model are you using?
AppService
### Which API approach are you accessing DAB through?
GraphQL
### Relevant log output
```Text
query SomeQuery {
someentityA(first: 10, orderBy: {columnA:DESC}, filter: {
and: [{ columnB: { neq: "EntityA" } }
{ or: [ { columnC: { eq: "CountryB" } } ] }
]}) {
items {
id
columnD
columnE
columnF
columnG
columnH
columnI
columnJ
columnK
columnL
columnM
columnN
columnO
someentityB(first: 10000) {
items {
id
columnP
someentityC(first: 10000) {
items {
id
columnQ
columnR
columnS
columnT
columnU
columnV
// ... rest of the query
}
}
}
}
}
}
```
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
コントリビューションガイド
調査の方向性
まず、提供された GraphQL クエリを Azure SQL に対して再現し、生成された SQL のページネーションおよび orderBy 述語を調べます。並べ替えとページネーションの SQL 生成パスを追跡します。降順および昇順の結果で、並べ替え値が null の場合にも期待されるレコードが維持されれば、issue は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- azure, csharp, graphql, sql
- 領域
- api, backend, databases
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100