silverstripe / silverstripe-graphql

Serves Silverstripe data as GraphQL representations
BSD 3-Clause "New" or "Revised" License
52 stars 61 forks source link

UpperCamelCase #469

Closed Zeeshanjbd2 closed 2 years ago

Zeeshanjbd2 commented 2 years ago

In old version we had UpperCamelCase and now we got LowerCamelCase, can we enable UpperCamelCase back using any yml configuration or any other way?

kinglozzer commented 2 years ago

Can you please provide more detail or an example?

Zeeshanjbd2 commented 2 years ago

In my old application i was using DB table i.e Member extends DataObject class => $db = [ 'Name' => 'Varchar' , 'Company' => 'Varchar' ]; now if i write read Graphql it will send response but their won't be any change in columns name according to graphql 3.8. In graphql 4 the naming convention is changed if i write Graphql it will return name, company (see how it lowers the first alphabet)

GuySartorelli commented 2 years ago

The formatter used for this is configurable: https://github.com/silverstripe/silverstripe-graphql/blob/98afc6f2c6cfb64decce24ff9ff7beffbdb81f3e/src/Schema/DataObject/FieldAccessor.php#L43

You can theoretically change the callable used in that config variable to something else, and that should work - though I haven't tested that.

GuySartorelli commented 2 years ago

I'm going to close this issue assuming that the above works - but if it doesn't, please feel free to re-open the issue and add details of exactly what doesn't work about it.