Skip to content

Commit

Permalink
throw for IQueryable used as an IEnumerable (#975)
Browse files Browse the repository at this point in the history
* Revert "force a ToList in Filter in case IEnumerable result is an open data reader (#974)"

This reverts commit a7f3520.

* throw for IQueryable used as an IEnumerable
  • Loading branch information
SimonCropp authored Jul 25, 2024
1 parent 28f929f commit 5ac88ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/GraphQL.EntityFramework/Filters/Filters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ internal virtual async Task<IEnumerable<TEntity>> ApplyFilter<TEntity>(IEnumerab
return result;
}

if (result is IQueryable)
{
throw new("This API expects the resolver to return a IEnumerable, not an IQueryable. Instead use AddQuery*");
}

var list = new List<TEntity>();
foreach (var item in result)
{
Expand Down

0 comments on commit 5ac88ac

Please sign in to comment.