-
-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ConnectionMiddleware and IEnumerable + IConnection #2378
Conversation
Don't assume an `IEnumerable`/`IQueryable` isn't already an `IConnection`
We should write one test to prove that it works. |
@@ -30,7 +30,11 @@ public ConnectionMiddleware(FieldDelegate next) | |||
context.Argument<string>("after"), | |||
context.Argument<string>("before")); | |||
|
|||
if (connectionResolver is { } && context.Result is TSource source) | |||
if (context.Result is IConnection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will have to look at the new implementation so that this will work with 11 as well.
Added a unit test for this scenario (checked without my fix and the test failed as I was seeing, so that's a good sign :P).
I'm just wondering one thing. Should the |
Added basic coverage of IQueryable and IEnumerable scenarios. |
Don't assume an
IEnumerable
/IQueryable
isn't already anIConnection