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

Inconsistency between input field and output field name conversion #47

Closed
wangyuesong opened this issue Aug 31, 2018 · 1 comment
Closed

Comments

@wangyuesong
Copy link

wangyuesong commented Aug 31, 2018

We are using rejoiner in production and found that there is an inconsistency between generated output field's GraphqlFieldDefinition and input field's field GraphqlInputObjectField.
For example, for a message like:
message Account { string account_p_code = 1 }
The input graphql type generated will be
Input_qapi_Account { account_p_code: string }
The output graphql type generated will be
qapi_Account { accountPCode: string }
This seems to be an inconsistency.
The logic generating fullName to GraphqlType map is here in ProtoRegistry.java
And it generates input type here in GqlInputConverter.java, which lacks camel case conversion

generates output type here in ProtoToGql.java

Is this intentional? And i don't see there is a way to configure it.

I can submit a PR with tests to
(1) Fix this inconsistency, but this might break existing user's behavior
(2) Configure this behavior somewhere? I haven't looked carefully and not sure if we already have some machanisms to configure the mapping between protobuf field names and graphql field names.

Let me know if this make sense and if i can help on that :) thanks!

@siderakis
Copy link
Member

siderakis commented Aug 31, 2018

I think consistently using camelcase is the best option.

If someone can’t upgrade because they need underscore case field names we can release an update that’s configurable at that time.

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

No branches or pull requests

2 participants