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

Additional method signatures for type extensions to remove the need for attributes

Open sunefred opened this issue 4 years ago • 3 comments

Is your feature request related to a problem? Please describe. Currently using type extensions, such as extending "Query", "Mutation" or others, require you to use the ExtendObjectTypeAttribute. For a project that does not otherwise require attributes this seems forced.

Describe the solution you'd like Add the following two additional IRequestExecutorBuilder extension methods for use in Startup.

AddTypeExtension<TExtension, TExtends>(this IRequestExecutorBuilder builder);
AddTypeExtension<TExtension>(this IRequestExecutorBuilder builder, Type extendsType);

sunefred avatar Aug 13 '21 12:08 sunefred

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 18:05 stale[bot]

Bump. I think this is a good addition.

oising avatar May 10 '22 17: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 Sep 07 '22 18:09 stale[bot]

'ExtendObjectTypeAttribute' translates to an ObjectTypeExtension meaning we would need to introduce something like an AddObjectTypeExtension.

michaelstaib avatar Feb 01 '23 19:02 michaelstaib

AddObjectTypeExtension <TExtension>(this IRequestExecutorBuilder builder, Action<IObjectTypeDescriptor<TExtension>> configure);

michaelstaib avatar Feb 01 '23 19:02 michaelstaib

I will move this back to the backlog for another release. For now you can substitute this on your own .... essentially wrap the T into ObjectTypeExtension<T>() and pass in the descriptor delegate to bind it to name or type.

michaelstaib avatar Feb 01 '23 19:02 michaelstaib