- #574 - Fixed `UseConnectionPaging()` on a field that is not on the root query type when its collection comes from EF - e.g. `schema.Type<Actor>().ReplaceField("movies", a => a.Movies.OrderByDescending(m => m.Released)).UseConnectionPaging()` - failing with `The LINQ expression 'edgeNode => ...' could not be translated`. As with offset paging above, the edges are now paged with `System.Linq`'s `Skip`/`Take`. Cursors were assigned by `ConnectionHelper.ApplyCursors` while enumerating the page, which EF can not translate inside a parent's projection, so for such a collection they are now set on the edges after EF materializes them. `last` (without `before`) on such a collection pages from the end of each parent's own collection - it relied on one total count shared by the whole request - and is taken as `Reverse().Take(last)` so EF can translate it, which needs the collection to be ordered. With `after` too, the rows up to `after` are then dropped from that page. `pageInfo { hasNextPage }` alone is an `EXISTS` query rather than loading the whole collection. Paging on root query fields is unchanged.
0 commit comments