Azure / Azure/data-api-builder
[Bug]: GraphQL pagination with order by statements omits values
- Ngôn ngữ chính
- C#
- Star
- 1.5k
- Fork
- 372
- Merge trung bình
- 3 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 9
Mô tả
### 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
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện truy vấn GraphQL được cung cấp trên Azure SQL và kiểm tra SQL được tạo ra để tìm các vị từ phân trang và orderBy. Theo dõi đường dẫn tạo SQL cho việc sắp xếp và phân trang; issue hoàn tất khi các kết quả theo thứ tự giảm dần và tăng dần vẫn giữ lại các bản ghi mong đợi với các giá trị sắp xếp null.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- azure, csharp, graphql, sql
- Lĩnh vực
- api, backend, databases
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100