pothos icon indicating copy to clipboard operation
pothos copied to clipboard

Global config for with-input and error type names

Open glennreyes opened this issue 3 years ago • 1 comments

Hey @hayes first of all thank you for this project, been enjoying exploring it so far a lot! 👏

I was wondering if there was a way to customize with-input or error type name templates (by the with-input or errors plugin), not on a per field, but on a global basis. I could imagine to have something like this on the builder config plugin option:

typeOptions: {
  name: ({ name, typename }) => `${capitalize(name)}Input`,
},

Note that I am omitting the prefixed typename here such as Mutation or Query. If that is currently not possible, would there be any reasonable objectives to not get something like this implemented?

Thanks!

glennreyes avatar Aug 26 '22 10:08 glennreyes

This doesn't exist yet, but could definitely be added in the future

hayes avatar Aug 26 '22 15:08 hayes

@hayes gonna give this one a shot

TheMightyPenguin avatar Nov 14 '22 22:11 TheMightyPenguin

This feature was just implemented for the errors plugin by @TheMightyPenguin, but we still need to add the same functionality to the with-input plugin

hayes avatar Jan 07 '23 02:01 hayes

just pushed a similar update for the with-input plugin, should be published in a couple minutes

hayes avatar Jan 07 '23 03:01 hayes