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

Remove toCamelCase / allow customisation? #49

Open
markhepburn opened this issue Oct 6, 2016 · 1 comment
Open

Remove toCamelCase / allow customisation? #49

markhepburn opened this issue Oct 6, 2016 · 1 comment

Comments

@markhepburn
Copy link
Contributor

Submitting this as a question or discussion point, as much as an issue.

GraphQLTypeBuilder adds fields using ToCamelCase when the name isn't explicitly supplied. (The implementation just lowercases the first character).

What's the rationale behind this choice?

We're using code-first models reverse-engineered from a database where everything is uppercase; it means that to query a property we either have to explicitly add each one by name (user.AddField("USER_ID", u => u.USER_ID)), or our queries look a bit odd: "uSER_ID".

@chkimes
Copy link
Owner

chkimes commented Oct 7, 2016

The rationale for using camel case was that the convention for GraphQL is to use camel-case names. Since the convention for C# properties is Pascal case, the ToCamelCase function just lowercases the first letter.

Adding customization for this is a good idea, and should also be pretty simple to implement.

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