graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

ExtendObjectType allows multiple instances on a class but only respects the last one

Open oising opened this issue 4 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

[ExtendObjectType(typeof(A))]
[ExtendObjectType(typeof(B))]
[ExtendObjectType(typeof(C))]
public class FooExtensions { ... }

Expectation: I would expect the extensions to be applied to all types: A, B & C.

Reality: The extensions are only applied to type C.

Steps to reproduce

n/a -- see description.

Relevant log output

n/a

Additional Context?

I know there are workarounds (use a common base class/interface) but in my case, this is not practical.

Product

Hot Chocolate

Version

12.2

oising avatar Nov 19 '21 18:11 oising

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 04 '22 01:05 stale[bot]

Is this fixed, @michaelstaib ? I can't remember.

oising avatar May 04 '22 01:05 oising

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 03 '22 02:07 stale[bot]

This was never intended to allow more than one. I fixed it now.

If you want to extend multiple classes at once use an interface or a base type as the generic. I made a video that goes into detail on this.

michaelstaib avatar Oct 25 '23 02:10 michaelstaib