Closed BerndWessels closed 2 years ago
You can alias field selections in your graphql query
query {
fieldOne: field_one
}
Other than that I believe such a change should be done on your server, not in the client.
If we start making assumptions and modifications to naming in the client we're bound to get buggy code which is hard to debug.
Finally, I'd also question the value of enforcing such casing. Why does it really matter? And will it not just create more confusion with inconsistent naming?
Thanks for the response @budde377 . The alias looks promising. It might be just my OCD but I just feel uncomfortable with snake case in the client site flutter code and graphql schema. This seems such a common issue not only for dart but C#, JS and other languages that I was hoping it has some generic solution. Doing it on the server would most likely be the best place, unfortunately I am using AppSync and doing it in VTL is pretty complex, but I might give it a shot. Cheers
Hello
When using graphql with a postgres backend there is a common need to translate between postgres snake case and graphql camel case. Especially since the dart client site usually also uses camel case.
Is there a way to do this with
graphql-flutter
?Ideally in a general way somewhere hidden in a link layer or something?
Thanks