Hi!
I have the following problem:
I can imagine users inserting information with trailing spaces, f.e. name "John " instead of just “John” in an Absinthe mutation. I don’t want to rely on people not doing that mistake (either the user of the api user/frontend).
Is there a smart way to ensure all string Absinthe query parameters have a function like String.trim_trailing/2 automatically applied to them?
Let me offer a different way of thinking. (I’m assuming that you want to normalize the data before persisting it.)
If you think of Absinthe (GraphQL) as one of potentially multiple interfaces then it makes more sense to normalize the data at the core (most likely your contexts). That way if you ever need an second interface, REST API, LiveView, etc you do not need to implement normalizing the data in that layer too.