-
-
Notifications
You must be signed in to change notification settings - Fork 799
Labels
Description
Product
Hot Chocolate
Version
15.1.8
Link to minimal reproduction
services.AddGraphQLServer()
.AddTypes()
.AddPagingArguments()
.AddSorting()
.AddQueryContext()
.AddFiltering();
// omitted for brevity
[QueryType]
public static class Query
{
[UsePaging]
[UseFiltering]
[UseSorting]
public static async Task<Connection<User>> GetUsers(
PagingArguments paging,
QueryContext<User> query
)
{
return Connection.Empty<User>();
}
}
public record User(
UserId Id,
FirstName FirstName,
LastName LastName,
PhoneNumber PhoneNumber
);Steps to reproduce
- Add a query field that returns a record type.
- Use
[UseFiltering]on that field. - Enable
QueryContext<T>and filtering using.AddQueryContext()andAddFiltering() - Run a query selecting your field.
What is expected?
No exception. A QueryContext<T> with a null Selector since we didn't use [UseSelection] on the field.
What is actually happening?
The same exception reported in #6487, even though the OP there is using [UseSelection] and I'm not. When you don't use [UseSelection], the expression-building code that causes this exception shouldn't even be executed; that's the expectation. This what distinguishes this issue from #6487.
Relevant log output
Additional context
No response