ChilliCream / ChilliCream/graphql-platform
Strawberry Shake Razor Components use RuntimeType instead of InterfaceType for Operation
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.8k
- Forks
- 810
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 98
Description
Product
Strawberry Shake
Version
15.0.0
Link to minimal reproduction
Steps to reproduce
Use Strawberry Shake to generate blazor query components
What is expected?
Operation Interface type used
What is actually happening?
Sample taken from the razor generation tests
public partial class UseGetBars : global::StrawberryShake.Razor.UseQuery<global::Foo.Bar.IGetBarsResult>
{
[global::Microsoft.AspNetCore.Components.InjectAttribute]
internal global::Foo.Bar.GetBarsQuery Operation { get; set; } = default !;
....
}
GetBarsQuery is used instead of IGetBarsQuery
This typically poses no issue until you try to mock the component for unit tests (Bunit)
Relevant log output
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Strawberry Shake Razor generation tests and the linked snapshot at src/StrawberryShake/CodeGeneration/test/CodeGeneration.Razor.Tests/snapshots/RazorGeneratorTests.Query_And_Mutation.snap#L1320. Trace how the generated component's Operation type is selected, then update the generation so it uses IGetBarsQuery and verify the Razor generation tests reflect the interface type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100