Skip to content

Commit

Permalink
Fixed Test Snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Dec 16, 2024
1 parent 24cf5c5 commit 4d6e37d
Show file tree
Hide file tree
Showing 13 changed files with 321 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ public async Task Policies_Are_Not_Cached_If_PolicyProvider_Disallows_Caching()
Assert.Null(result1.Errors);
Assert.Equal(HttpStatusCode.OK, result2.StatusCode);
Assert.Null(result2.Errors);

#if NET6_0
Assert.Equal(1, policyProvider.InvocationsOfGetPolicyAsync);
#else
Assert.Equal(2, policyProvider.InvocationsOfGetPolicyAsync);
#endif
}

public class Query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ enum Unit {
"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`."
directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT

directive @foo(bar: Int!) on SUBSCRIPTION

"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`."
directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

```text
Headers:
ETag: "1-kBEjhe2t+jfqbeZRxnezu0WDQFYAc0qzjLF1RlHs428="
ETag: "1-kqrhyLMoq/15r5KsM6OidIHC9SxZ/RTdPKy5i3Bw42Y="
Cache-Control: public, must-revalidate, max-age=3600
Content-Type: application/graphql; charset=utf-8
Content-Disposition: attachment; filename="schema.graphql"
Last-Modified: Fri, 01 Jan 2021 00:00:00 GMT
Content-Length: 5070
Content-Length: 5113
-------------------------->
Status Code: OK
-------------------------->
Expand Down Expand Up @@ -135,6 +135,8 @@ enum Unit {
"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`."
directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT
directive @foo(bar: Int!) on SUBSCRIPTION
"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`."
directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

```text
Headers:
ETag: "1-kBEjhe2t+jfqbeZRxnezu0WDQFYAc0qzjLF1RlHs428="
ETag: "1-kqrhyLMoq/15r5KsM6OidIHC9SxZ/RTdPKy5i3Bw42Y="
Cache-Control: public, must-revalidate, max-age=3600
Content-Type: application/graphql; charset=utf-8
Content-Disposition: attachment; filename="schema.graphql"
Last-Modified: Fri, 01 Jan 2021 00:00:00 GMT
Content-Length: 5070
Content-Length: 5113
-------------------------->
Status Code: OK
-------------------------->
Expand Down Expand Up @@ -135,6 +135,8 @@ enum Unit {
"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`."
directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT
directive @foo(bar: Int!) on SUBSCRIPTION
"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`."
directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
},
"extensions": {
"sql": "-- @__p_0='1'\n-- @__p_1='4'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @__p_0 AND b.\"Id\" < @__p_1\nORDER BY b.\"Id\"\nLIMIT @__p_2"
"sql": "-- @__p_0='1'\n-- @__p_1='4'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE (b.\"Id\" > @__p_0) AND (b.\"Id\" < @__p_1)\nORDER BY b.\"Id\"\nLIMIT @__p_2"
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
},
"extensions": {
"sql": "-- @__p_0='97'\n-- @__p_1='100'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @__p_0 AND b.\"Id\" < @__p_1\nORDER BY b.\"Id\" DESC\nLIMIT @__p_2"
"sql": "-- @__p_0='97'\n-- @__p_1='100'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE (b.\"Id\" > @__p_0) AND (b.\"Id\" < @__p_1)\nORDER BY b.\"Id\" DESC\nLIMIT @__p_2"
}
}
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,153 @@
# BatchPaging_Last_5

## 1

```json
{
"First": "MTAw",
"Last": "OTk=",
"Items": [
{
"Id": 100,
"Name": "Product 0-99",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 1,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
},
{
"Id": 99,
"Name": "Product 0-98",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 1,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
}
]
}
```

## 2

```json
{
"First": "MjAw",
"Last": "MTk5",
"Items": [
{
"Id": 200,
"Name": "Product 1-99",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 2,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
},
{
"Id": 199,
"Name": "Product 1-98",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 2,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
}
]
}
```

## 3

```json
{}
{
"First": "MzAw",
"Last": "Mjk5",
"Items": [
{
"Id": 300,
"Name": "Product 2-99",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 3,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
},
{
"Id": 299,
"Name": "Product 2-98",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 3,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
}
]
}
```

## SQL 0

```sql
SELECT t."BrandId", t0."Id", t0."AvailableStock", t0."BrandId", t0."Description", t0."ImageFileName", t0."MaxStockThreshold", t0."Name", t0."OnReorder", t0."Price", t0."RestockThreshold", t0."TypeId"
FROM (
SELECT p."BrandId"
FROM "Products" AS p
WHERE p."BrandId" IN (1, 2, 3)
GROUP BY p."BrandId"
) AS t
LEFT JOIN (
SELECT t1."Id", t1."AvailableStock", t1."BrandId", t1."Description", t1."ImageFileName", t1."MaxStockThreshold", t1."Name", t1."OnReorder", t1."Price", t1."RestockThreshold", t1."TypeId"
FROM (
SELECT p0."Id", p0."AvailableStock", p0."BrandId", p0."Description", p0."ImageFileName", p0."MaxStockThreshold", p0."Name", p0."OnReorder", p0."Price", p0."RestockThreshold", p0."TypeId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Id" DESC) AS row
FROM "Products" AS p0
WHERE p0."BrandId" = 1 OR p0."BrandId" = 2 OR p0."BrandId" = 3
) AS t1
WHERE t1.row <= 3
) AS t0 ON t."BrandId" = t0."BrandId"
ORDER BY t."BrandId", t0."BrandId", t0."Id" DESC
```

## Expression 0

```text
[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => (((t.BrandId == 1) OrElse (t.BrandId == 2)) OrElse (t.BrandId == 3))).GroupBy(k => k.BrandId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderByDescending(p => p.Id).Take(3).ToList()})
```

Original file line number Diff line number Diff line change
@@ -1,5 +1,153 @@
# BatchPaging_Last_5

## 1

```json
{
"First": "MTAw",
"Last": "OTk=",
"Items": [
{
"Id": 100,
"Name": "Product 0-99",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 1,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
},
{
"Id": 99,
"Name": "Product 0-98",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 1,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
}
]
}
```

## 2

```json
{
"First": "MjAw",
"Last": "MTk5",
"Items": [
{
"Id": 200,
"Name": "Product 1-99",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 2,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
},
{
"Id": 199,
"Name": "Product 1-98",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 2,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
}
]
}
```

## 3

```json
{}
{
"First": "MzAw",
"Last": "Mjk5",
"Items": [
{
"Id": 300,
"Name": "Product 2-99",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 3,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
},
{
"Id": 299,
"Name": "Product 2-98",
"Description": null,
"Price": 0.0,
"ImageFileName": null,
"TypeId": 1,
"Type": null,
"BrandId": 3,
"Brand": null,
"AvailableStock": 0,
"RestockThreshold": 0,
"MaxStockThreshold": 0,
"OnReorder": false
}
]
}
```

## SQL 0

```sql
SELECT t."BrandId", t0."Id", t0."AvailableStock", t0."BrandId", t0."Description", t0."ImageFileName", t0."MaxStockThreshold", t0."Name", t0."OnReorder", t0."Price", t0."RestockThreshold", t0."TypeId"
FROM (
SELECT p."BrandId"
FROM "Products" AS p
WHERE p."BrandId" IN (1, 2, 3)
GROUP BY p."BrandId"
) AS t
LEFT JOIN (
SELECT t1."Id", t1."AvailableStock", t1."BrandId", t1."Description", t1."ImageFileName", t1."MaxStockThreshold", t1."Name", t1."OnReorder", t1."Price", t1."RestockThreshold", t1."TypeId"
FROM (
SELECT p0."Id", p0."AvailableStock", p0."BrandId", p0."Description", p0."ImageFileName", p0."MaxStockThreshold", p0."Name", p0."OnReorder", p0."Price", p0."RestockThreshold", p0."TypeId", ROW_NUMBER() OVER(PARTITION BY p0."BrandId" ORDER BY p0."Id" DESC) AS row
FROM "Products" AS p0
WHERE p0."BrandId" = 1 OR p0."BrandId" = 2 OR p0."BrandId" = 3
) AS t1
WHERE t1.row <= 3
) AS t0 ON t."BrandId" = t0."BrandId"
ORDER BY t."BrandId", t0."BrandId", t0."Id" DESC
```

## Expression 0

```text
[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Where(t => (((t.BrandId == 1) OrElse (t.BrandId == 2)) OrElse (t.BrandId == 3))).GroupBy(k => k.BrandId).Select(g => new Group`2() {Key = g.Key, Items = g.OrderByDescending(p => p.Id).Take(3).ToList()})
```

Loading

0 comments on commit 4d6e37d

Please sign in to comment.