Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When using the UseProjection attribute, @defer does not work anymore. I could not find any info if this scenario is currently not supported or if it is a bug.
Easily reproducible with this setup:
public class Book
{
public string Cheap => "Foo";
public async Task<string> Expensive()
{
await Task.Delay(10000);
return "Bar";
}
}
public class Query
{
private static readonly Book _book = new();
public Book GetBook() => _book;
}
Then sending this query:
query Test {
book {
cheap
... @defer(label: "deferredValue") {
expensive
}
}
}
Works perfectly fine. If you put [UseProjection] on the GetBook method it breaks and takes 10 seconds to load with the same query.
public class Query
{
private static readonly Book _book = new();
[UseProjection]
public Book GetBook() => _book;
}
This issue is maybe linked to the same problem: #5386
Steps to reproduce
- Use code from above without UseProjection attribute -> works fine
- Put UseProjection attribute on GetBook method -> does not work anymore, loading takes 10 seconds even with @defer
Relevant log output
No response
Additional Context?
No response
Product
Hot Chocolate
Version
12.15.0