GithubHelp home page GithubHelp logo

Comments (9)

eacvortx avatar eacvortx commented on July 25, 2024 1

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.

dalssoft avatar dalssoft commented on July 25, 2024 1

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.

jhomarolo-vortx avatar jhomarolo-vortx commented on July 25, 2024

Hi Brian, good suggestion.
Do you have any idea what the outline of this feature would look like in the code?

from herbs2gql.

BrsPontes-Vortx avatar BrsPontes-Vortx commented on July 25, 2024

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.

jhomarolo-vortx avatar jhomarolo-vortx commented on July 25, 2024

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.

BrsPontes-Vortx avatar BrsPontes-Vortx commented on July 25, 2024

@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.

eacvortx avatar eacvortx commented on July 25, 2024

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.

BrsPontes-Vortx avatar BrsPontes-Vortx commented on July 25, 2024

I think is god idea

from herbs2gql.

BrsPontes-Vortx avatar BrsPontes-Vortx commented on July 25, 2024

Good Morning,
@dalssoft the pr that was sent has this change commented

from herbs2gql.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.