Comments (9)
Why not both?
if we use customName, ignore the flag of camelCase, else we can just ignore or not the camelCase as you has proposed...
from herbs2gql.
sorry guys. I've been late to this issue. I like the idea of change the convetions and I think this is very important to be able to bring your own. actually its one of the Herbs principles to be able to change these conventions (unlike imposed conventions like Rails).
however, we should improve herbs2gql and others herbs libraries and glues not in a small way (ex: ignoreCamelCase = true or false
) but in a more general way (for instance: nameConvetion : function(name) {...}
) so you can change to any way you want.
I think the current PR is too restrictive.
One more thing. We should have a more readble way to inform this optionals paramters.
Intead of
const gql = entity2type(givenAnEntity, nameConvetion, 'EntityCustom')
it could be
const gql = entity2type(givenAnEntity, { nameConvetion: nameFunc, entityName : 'EntityCustom' })
or even better
const conventions = { entityName: nameFunc }
const gql = entity2type(givenAnEntity, { conventions: conventions, entityName : 'EntityCustom' })
from herbs2gql.
Hi Brian, good suggestion.
Do you have any idea what the outline of this feature would look like in the code?
from herbs2gql.
Hi Jhonathan, I have some idea, adding boolean variable in method that converts ignoreCamelCase
,
this is variable with the default value false and keeping the camelcase
but true case, the camel case is ignored,
this way we keep the herbs pattern and we can add a cutomizable according to what we want
What do you think about this?
from herbs2gql.
I believe that more than putting a flag on ignoring camel cases, we actually have a way of choosing the different types of cases that we would like to use.
from herbs2gql.
@jhomarolo-vortx, Good morning,
I think that different types would not be the ideal solution, we would be forcing them to use standards imposed by herbs
Exemple: method toUpperCase()
returns FOO
Instead of leaving patterns ready, by ignoring the camel case, if a developer wants to use FoOBaR or FooBar
it's possible
like this
let gql = ""
gql += `type ${ignoreCamelCase === true ? entity.name : upperFirst(camelCase(entity.name))} {\n`
gql += entityField2gql(entity)
gql += "}"
return gql
What do you think about this?
from herbs2gql.
Why not pass a customName as option? With this my uc can be "Should Do Something", with my query being "showCustomBrebows"...
something like:
usecase2query( uc(), resolver(), { customName: "showCustomBrebows" } )
make sense?
from herbs2gql.
I think is god idea
from herbs2gql.
Good Morning,
@dalssoft the pr that was sent has this change commented
from herbs2gql.
Related Issues (12)
- Return usecase errors in defaultResolver HOT 2
- required usecase-response into usecase2mutation HOT 3
- Handle Known Erros for better outputs
- discord test HOT 1
- Upgrade package Apollo Server HOT 1
- Update graphql to 16.x version HOT 2
- Herbarium - Use it to create mutations, queries and types HOT 5
- Error using a entity as a field of another entity HOT 6
- Add dependencies of the lib from devDependencies to peerDependencies HOT 1
- Issue with "requestFieldType2gql" function and GraphQL Input types HOT 9
- Type conversion error when there are spaces in the entity name
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from herbs2gql.