Closed brainlid closed 3 years ago
there's no option for this and I prefer not to add it. if you need this you might want to add your own json library instead? one that would take the map and do this conversion.
Ok. Thanks for letting me know that there is no built-in support for it.
NOTE: For others who find this request.
I ended up using recase
for help with pre-processing the arguments. https://github.com/sobolevn/recase
tl;dr
It appears that when making a request with Neuron to a Rails GraphQL API, there is no conversion (or config options for it that I could find) to deal with how a key is translated. I want to send a snake-case key like
my_special_key
and have it submitted asmySpecialKey
.This is an issue with arguments being submitted in a mutation for example.
Is this possible or already available?
More detailed:
The API I'm talking to expects a key to be called "organizationId". It fails if I send a map like this:
The server isn't adapting to it and I haven't seen how to tell the Neuron client to do something different with it. I have to send:
I can deal with that for simple data, but I also have data that passes a large, deeply nested Elixir map. I'd have to convert all the keys before sending.
Is there a built-in way to deal with this? A parser option or something I didn't see?