Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Ability to name input object types #228

Open
ccbrown opened this issue Mar 1, 2019 · 1 comment
Open

Ability to name input object types #228

ccbrown opened this issue Mar 1, 2019 · 1 comment

Comments

@ccbrown
Copy link

ccbrown commented Mar 1, 2019

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.

@ijsnow
Copy link

ijsnow commented Dec 18, 2019

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants