Skip to content

test(strawberry-shake): regression guard for inheritance codegen (#5593)#15

Open
cliedeman wants to merge 1 commit into
fork-ci-basefrom
fix/ss-inheritance-base-class-already-defined
Open

test(strawberry-shake): regression guard for inheritance codegen (#5593)#15
cliedeman wants to merge 1 commit into
fork-ci-basefrom
fix/ss-inheritance-base-class-already-defined

Conversation

@cliedeman

@cliedeman cliedeman commented Jun 27, 2026

Copy link
Copy Markdown

Summary

Relates to ChilliCream#5593 ("StrawberryShake v13 not generating source for schema with inheritance"). The issue reported that when two object types share a common interface base (the reporter's Exercise and Survey both implementing Activity), the v13 generator emitted a duplicate base class and failed with error HC0065: The name 'Activity' was already registered / "base class already defined".

Verified: this no longer reproduces on the current main. The shared-interface scenario now generates correct C# (one shared base interface, each implementation deriving it exactly once) and compiles. Rather than a fix for a live defect, this PR adds a regression guard that locks in the now-correct behavior.

What was checked

  • Reconstructed the issue's gist schema (it was incomplete: missing Query/Mutation/Subscription bodies, the ApplyPolicy enum, StringOperationFilterInput, and PageInfo). After filling in only those omissions, without altering the Activity/Exercise/Survey shapes, all operation variants generated cleanly. The only failures encountered were unrelated missing-type errors from the incomplete gist, never the inheritance duplicate-base defect.
  • Confirmed the generated output is the correct interface pattern: a shared base interface with two derived interfaces/classes, no duplicate base, no HC0065, no non-compiling output.

Tests

New InheritanceGeneratorTests covering the issue's shape via GeneratorTestHelper.AssertResult (which Roslyn-compiles the generated output), with two operation variants:

  • interface selected directly as a list ([Activity!]!) with inline fragments on both implementations
  • interface selected via a connection nodes field

Both pass across all target frameworks. Surrounding generator test classes (EntityGeneratorTests, ResultTypeGeneratorTests, StarWarsGeneratorTests) remain green (124 passed, 0 failed).

— Claude
🤖 Generated with Claude Code

…e base

Adds a regression guard for the scenario in ChilliCream#5593,
where two object types sharing a common interface base (Exercise and Survey
both implementing Activity) made StrawberryShake v13 emit a duplicate base
class and fail with "base class already defined" / HC0065.

The scenario was verified against the issue's schema shape and generates
correctly on the current type-system pipeline, so this locks in the now-correct
behavior rather than fixing a live defect. Two operation shapes are covered:
the interface selected directly as a list, and via a connection `nodes` field,
each with inline fragments on both implementations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants