Skip to content

Commit b7e9659

Browse files
authored
Added section regarding SingleOrDefaultMiddleware to migration guide (#8071)
1 parent ac92780 commit b7e9659

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

website/src/docs/hotchocolate/v14/migrating/migrate-from-13-to-14.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,16 @@ ModifyRequestOptions(o => o.OnlyAllowPersistedOperations = true);
252252
ModifyRequestOptions(o => o.PersistedOperations.OnlyAllowPersistedDocuments = true);
253253
```
254254

255+
# Other changes
256+
257+
## Change to `SingleOrDefaultMiddleware`
258+
259+
As a side-effect of fixing [a bug](https://github.com/ChilliCream/graphql-platform/issues/5566) in the `SingleOrDefaultMiddleware`, usage of this middleware along with EF Core may result in a warning being logged, as follows:
260+
261+
> The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results. If the 'Distinct' operator is used after 'OrderBy', then make sure to use the 'OrderBy' operator after 'Distinct' as the ordering would otherwise get erased.
262+
263+
We are looking at fixing this in a different way in the future (see [#8070](https://github.com/ChilliCream/graphql-platform/issues/8070)), but for now you can work around this by returning an `IExecutable` from your resolver by calling `AsDbContextExecutable()` on your `IQueryable` or `DbSet`, or by using `Executable.From(...)`.
264+
255265
# Deprecations
256266

257267
Things that will continue to function this release, but we encourage you to move away from.

0 commit comments

Comments
 (0)