Skip to content

Strawberry Shake Razor Components use RuntimeType instead of InterfaceType for Operation #9635

Description

@cliedeman

Product

Strawberry Shake

Version

15.0.0

Link to minimal reproduction

https://github.com/ChilliCream/graphql-platform/blob/main/src/StrawberryShake/CodeGeneration/test/CodeGeneration.Razor.Tests/__snapshots__/RazorGeneratorTests.Query_And_Mutation.snap#L1320

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions