Azure / Azure/data-api-builder

[Bug]: GraphQL pagination with order by statements omits values

Aperta
#2,274 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
🛠️troubleshooting bug cri triage
Lingua principale
C#
Stelle
1.5k
Fork
370
Merge medio
3g 22h
PR unite (30g)
9

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo la query GraphQL fornita su Azure SQL e ispeziona l'SQL generato alla ricerca dei predicati di paginazione e orderBy. Traccia il percorso di generazione dell'SQL per l'ordinamento e la paginazione; l'issue è completata quando i risultati in ordine decrescente e crescente mantengono i record previsti con valori di ordinamento null.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, csharp, graphql, sql
Ambito
api, backend, databases
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.