How to support i18n on Absinthe

I’m designing my Relay schema, and I need to support multiple languages.
So on the “db” side I chose jsonb psql columns(i.e. [{"en" => "hello world"}, {"es" => "Hola mundo!"}])

So, on the query side, I need to allow client API be able to specify which language is using: en for example.
But also, the query could need to get all the languages values(it could be useful for update those string values)

I saw GraphQL supports directive but I wasn’t able to see a working example of how to implement that on Absinthe.

Also, I’m not sure is the directive approach is the correct one.

1 Like