graphql-platform
graphql-platform copied to clipboard
Additional method signatures for type extensions to remove the need for attributes
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);
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.
Bump. I think this is a good addition.
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.
'ExtendObjectTypeAttribute' translates to an ObjectTypeExtension meaning we would need to introduce something like an AddObjectTypeExtension.
AddObjectTypeExtension <TExtension>(this IRequestExecutorBuilder builder, Action<IObjectTypeDescriptor<TExtension>> configure);
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.