Followup issue of: #1335
Describe the bug
If an OR filter is applied and a variable is inside the filters fail.
I am not sure if this is invalid and i didn't get this of the spec or if it is related to #192
After the argument is resolver with context.Argument<IValueNode>("argname") the variables in a object in a list are not replaced.
Working example with object:

Not working example with Array OR:[]:

If the variables are not resolved the operation handlers do not recognize the type because in this example Variable == String
https://github.com/ChilliCream/hotchocolate/blob/master/src/Core/Types.Filters/Expressions/OperationHandlers/String/StringOperationHandlerBase.cs#L20
This leads to an empty queue and therefore
Queue empty.
at System.Collections.Generic.Queue`1.ThrowForEmptyQueue()
at System.Collections.Generic.Queue`1.Peek()
at HotChocolate.Types.Filters.QueryableFilterVisitor.CreateFilter[TSource]()
at HotChocolate.Types.Filters.QueryableFilterMiddleware`1.InvokeAsync(IMiddlewareContext context)
at HotChocolate.Execution.ExecutionStrategyBase.ExecuteMiddlewareAsync(ResolverContext resolverContext, IErrorHandler errorHandler)
To Reproduce
Executes the tests QueryableFilterTests.Execute_String_Filter_WithVariable_OR in this pull request: #1353
Expected behavior
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
Additional context
Thanks to @NickBeukema and @freever for reporting it
FYI this also applies to AND
Can you guys recheck with 10.3.3
I tried with 10.3.3 with the following query and still getting the Queue Empty error:
contactGetAll (where: { OR: [{ lastName_contains: $searchTerm }, { firstName_contains: $searchTerm }] }) {
customer {
name
}
}
@PascalSenn has written some tests on the V11 branch ... so I hopefully get my PR tomorrow in. With that I can check what the issue still is.
It might now be something different since I have variables in lists that have objects now under test. There were was an issue the query rewriter regarding this.
@michaelstaib My case is working with 10.3.3:
query searchPatents($searchText: String!) {
patents(where: {OR: [{applicationNumber: $searchText} {patentNumber: $searchText} {publicationNumber: $searchText}]}) {
totalCount
}
}
Most helpful comment
@michaelstaib My case is working with 10.3.3: