Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema Gen: Add Option for Preserving Input Names #1186

Merged

Conversation

LaurenceWarne
Copy link
Contributor

Hi! This PR adds the --preserveInputNames option to the schema gen cli which will prompt the case classes of Input types to be generated with the @GQLInputName("$name") where name is the name of the Input type.

The motivation is that I would like the derived schema to be as close as possible to the .gql file used as input to the schema gen, so I will often name my input types like FooInput, but then this is changed in the derived schema to FooInputInput 🙂

Thanks

@ghostdogpr
Copy link
Owner

Looks great. How about making it the default actually? I think most users expect it to work that way.

@LaurenceWarne
Copy link
Contributor Author

Looks great. How about making it the default actually? I think most users expect it to work that way.

Yeah that's what I originally thought, but would this break existing builds? For example, someone using FooArgs in their schema file and then having their client use FooArgsInput - though this is a little peculiar I admit 😄

Happy to make it the default if you think it's not a big deal.

@ghostdogpr
Copy link
Owner

Maybe let's keep it this way and I might change it in a future major version. Don't really want to break on a minor version 😄

@ghostdogpr ghostdogpr merged commit c28285d into ghostdogpr:master Dec 2, 2021
@LaurenceWarne
Copy link
Contributor Author

Thanks!

Fluxx pushed a commit to Fluxx/caliban that referenced this pull request Jan 24, 2022
Fluxx pushed a commit to Fluxx/caliban that referenced this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants