You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The author field is included in the response, as the resolver is checking whether it was selected with the IsSelected attribute, which should be returning true since the field was in fact included.
What is actually happening?
The author field in the response is null.
Relevant log output
Additional context
It does work correctly for the case where a single book is retrieved, eg the following query
It checks for the selection type being a composite type, but in the case of the books query it is a List type (or more precisely NotNullType with inner type of List). so the line above causes the logic for IsSelected to immediately return false, even without checking the selection set.
I verified locally that if you just change that to allow for List types, then the rest of the checking logic will work.
The text was updated successfully, but these errors were encountered:
Product
Hot Chocolate
Version
14.3
Link to minimal reproduction
https://github.com/CNaught-Inc/hotchocolate-repro-isselected
Steps to reproduce
Run the example, and send the following query:
What is expected?
The
author
field is included in the response, as the resolver is checking whether it was selected with theIsSelected
attribute, which should be returning true since the field was in fact included.What is actually happening?
The
author
field in the response is null.Relevant log output
Additional context
It does work correctly for the case where a single book is retrieved, eg the following query
correctly includes
author
in the response.I believe the culprit is this line:
https://github.com/ChilliCream/graphql-platform/blob/main/src/HotChocolate/Core/src/Types/Extensions/ResolverContextExtensions.cs#L665
It checks for the selection type being a composite type, but in the case of the
books
query it is a List type (or more precisely NotNullType with inner type of List). so the line above causes the logic forIsSelected
to immediately return false, even without checking the selection set.I verified locally that if you just change that to allow for List types, then the rest of the checking logic will work.
The text was updated successfully, but these errors were encountered: