question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQUEST] Global naming convention

See original GitHub issue

With the introduction of the Custom GraphQL Root Fields and GraphQL Field Name features, one can specify the name used in the schema generation, for every field and table. This is very useful, especially, when referencing from client apps. But, this might become overhead for very large schemas, spanning across multiple Postgres schemas.

I would like to see a feature where one can specify the naming convention globally (perhaps at a schema level?), e.g. camelCase, PascalCase, etc.

This should be available for table names, field names, mutation names and relationship names.

Bonus Request:

  • Would be even more amazing if we could define additional text to the naming convention, e.g. insert mutations: 'add'${PascalCase table name}
  • Also be able to specify singular or plural in the convention, e.g. by_pk query name: ${singular camelCase table name} and normal select query: ${plural camelCase table name}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:155
  • Comments:29 (6 by maintainers)

github_iconTop GitHub Comments

25reactions
Maxviencommented, Feb 29, 2020

As a JavaScript developer, I really want this feature.

20reactions
daniel-xyzcommented, Nov 2, 2020

For most users this customisation probably wouldn’t be needed if Hasura would transform all table/column/relation names to GraphQL conventions automatically the same way that Postgraphile does it: https://www.graphile.org/postgraphile/inflection/

On one hand it’s nice that you can rename all fields by yourself, but on the other it is frustrating that you’re still stuck to the GraphQL type names that Hasura generates from tacked tables. For example, I now have camelCase fields but snake_case types and can’t find any option to rename those types apart from defining new custom types.

The whole customization shouldn’t even be necessary in the first place. I think it’s a “nice to have”, but more importantly, Hasura should apply common GraphQL conventions automatically or via a checkbox when you’re about to track new tables. This is something that I, as a new user, miss by far the most after a few days playing around with Hasura.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Guide on data entity naming conventions - GovInfo
To this end, the Bureau conductsresearch to assure international competitiveness and ... is to require uniqueness of every entry name in the dictionary....
Read more >
Naming conventions | Cloud APIs
The request and response messages for RPC methods should be named after the method names with the suffix Request and Response , respectively,...
Read more >
Define your naming convention - Cloud Adoption Framework
An effective naming convention consists of resource names from important information about each resource. A good name helps you quickly ...
Read more >
Style guide - GitLab Docs
Style guide. This document describes various guidelines and best practices for GitLab Helm chart development. Naming Conventions.
Read more >
Naming convention (programming) - Wikipedia
In computer programming, a naming convention is a set of rules for choosing the character sequence to be used for identifiers which denote...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found