-
-
Notifications
You must be signed in to change notification settings - Fork 756
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed: Preserve ordering when executing batched paging queries. (#7994)
- Loading branch information
1 parent
b8fcc1c
commit 6c393d3
Showing
18 changed files
with
191 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/HotChocolate/Data/test/Data.PostgreSQL.Tests/Types/Brands/BrandSortInputType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
src/HotChocolate/Data/test/Data.PostgreSQL.Tests/Types/Products/ProductNode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/HotChocolate/Data/test/Data.PostgreSQL.Tests/Types/Products/ProductQueries.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using GreenDonut.Data; | ||
using HotChocolate.Data.Models; | ||
using HotChocolate.Data.Services; | ||
using HotChocolate.Types; | ||
using HotChocolate.Types.Pagination; | ||
|
||
namespace HotChocolate.Data.Types.Products; | ||
|
||
|
||
[QueryType] | ||
public static partial class ProductQueries | ||
{ | ||
[UsePaging] | ||
[UseFiltering] | ||
[UseSorting] | ||
public static async Task<Connection<Product>> GetProductsAsync( | ||
PagingArguments pagingArgs, | ||
QueryContext<Product> query, | ||
ProductService productService, | ||
CancellationToken cancellationToken) | ||
=> await productService.GetProductsAsync(pagingArgs, query, cancellationToken).ToConnectionAsync(); | ||
} |
2 changes: 1 addition & 1 deletion
2
src/HotChocolate/Data/test/Data.PostgreSQL.Tests/Types/Products/ProductSortInputType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...greSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Query_Products_First_2_And_Brand | ||
|
||
## Result | ||
|
||
```json | ||
{ | ||
"data": { | ||
"products": { | ||
"nodes": [ | ||
{ | ||
"name": "Zero Gravity Ski Goggles", | ||
"brand": { | ||
"name": "Gravitator" | ||
} | ||
}, | ||
{ | ||
"name": "Zenith Cycling Jersey", | ||
"brand": { | ||
"name": "B&R" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Query 1 | ||
|
||
```sql | ||
-- @__p_0='3' | ||
SELECT p."Name", p."BrandId", p."Id" | ||
FROM "Products" AS p | ||
ORDER BY p."Name" DESC, p."Id" | ||
LIMIT @__p_0 | ||
``` | ||
|
||
## Query 2 | ||
|
||
```sql | ||
-- @__ids_0={ '2', '5' } (DbType = Object) | ||
SELECT b."Id", b."Name" | ||
FROM "Brands" AS b | ||
WHERE b."Id" = ANY (@__ids_0) | ||
``` | ||
|
Oops, something went wrong.