thunder icon indicating copy to clipboard operation
thunder copied to clipboard

Ability to name input object types

Open ccbrown opened this issue 5 years ago • 1 comments

As far as I can tell, it's not possible to create input objects without the "_InputObject" suffix. I would much prefer to be able to create input objects with simply an "Input" suffix. This matches the convention of all of the other GraphQL systems we've built and interact with.

Is this currently possible?

It would make the most sense to me if input objects could optionally be explicitly registered in the same way as other objects:

schema.InputObject("FooInput", FooInput{})

This would also have the benefit of facilitating input object descriptions and potentially other features.

ccbrown avatar Mar 01 '19 23:03 ccbrown

This doesn't seem possible. This seems fine when you're building an API for your consumption only but I'm working on an API that other systems will consume and I'd like to keep the type system clean. I've evaluated gqlgen and this library and would prefer to use this one but need this ability.

I'd be happy to work on a PR for this if you are willing to accept this change. I imagine there is an API we can come up with that would allow support for this without breaking existing users of this library. If you are willing to accept the change, I'd appreciate pointers to files/packages I may be interested in as I haven't explored the source code yet.

Thanks!

ijsnow avatar Dec 18 '19 18:12 ijsnow