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

Add support for camelCase in users table #52

Closed
noverby opened this issue Jun 25, 2021 · 6 comments
Closed

Add support for camelCase in users table #52

noverby opened this issue Jun 25, 2021 · 6 comments

Comments

@noverby
Copy link

noverby commented Jun 25, 2021

Currently, all user fields are snake_case.
According to https://docs.nhost.io/auth/custom-user-columns, these fields should not be deleted.
But using snake_case does fit well into the standard JavaScript convention to use camelCase.

Therefore, it would be neat if nhost supported camelCase.

@joshua1
Copy link

joshua1 commented Sep 30, 2021

you can alias your fields (columns) with camelCase properties, and this will be picked up and used in your graphQl queries,mutations,subscriptions

@noverby
Copy link
Author

noverby commented Oct 1, 2021

I know that, but I'm using auto-generated GraphQL bindings (GQty), and therefore it will just be cleaner, if you can avoid having to do the renaming manually.

@joshua1
Copy link

joshua1 commented Oct 1, 2021

I use GenQL. you can follow this issue: hasura/graphql-engine#3320.

@joshua1
Copy link

joshua1 commented Nov 8, 2021

@noverby hasura-camelize will do the job. run it before generating types each time

@elitan
Copy link
Contributor

elitan commented Jan 19, 2022

This is now implemented. All tables in auth and storage schemas are using camelCase.

Reference: https://github.com/nhost/hasura-auth/blob/main/src/metadata.ts#L211-L235

@elitan elitan closed this as completed Jan 19, 2022
@dohomi
Copy link
Contributor

dohomi commented Oct 13, 2022

@elitan I just found out about this feature of Hasura. What happens if I would like to change my naming convention to graphql_default instead of hasura_default? What will happen to the existing tables and columns? Is that something I can change with an existing database/schema or does it need to be defined in the beginning of a project?

plmercereau added a commit that referenced this issue Dec 2, 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

No branches or pull requests

4 participants