Localization (l11n) strategy with Hasura for getting data in given locale
See original GitHub issueHi, I’m thinking about how to better implement localization with Hasura Engine and my thought that this should be implemented on HE side somehow.
One possible solution is by send -H "Accept-Language: en_US"
header for example, but what will do with this HE to get right localized data from the right column - I have no idea 😃 This way works Yelp GraphQL API
Currently, I’m sending locale in where
clause of GQL input. Here is an example:
Table products: id PK, price, type
Table products_translation: product_id FK, lang, name, description
Hasura array relationship: productValues products_translation :: product_id → id
Query:
{
products {
id
type
productValues(where: {lang: {_eq: "en_US"}}) {
name
description
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Location | Location Awareness | Hasura GraphQL - Hasura
Build backends for location-aware apps using Postgres & GraphQL. ... The fastest way to get started with Hasura is to try out one...
Read more >Building a Realtime Geolocation App with Hasura GraphQL ...
In this post, we will look at building a data-heavy real-time geo-location app with PostGIS and Hasura GraphQL to plot nearby restaurants on ......
Read more >Managing development environments | Hasura GraphQL Docs
Step 1: Setup local development of Hasura with Docker. Follow the guide here to get up and running with Hasura GraphQL engine and...
Read more >Postgres: Filter query results / search queries - Hasura
For example, to fetch data for an author whose name is "Sidney": query { ... Fetch a list of geometry values which are...
Read more >Internationalization with Hasura: How to Make Your Backend ...
There are many effective patterns and tools for localizing client-side web content, but what about data stored and/or computed by your backend?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Do you guys have any project example configuration for this? I want to accomplish something like @coco98 but the links in his post are broken. Thanks for the help in advance
@Bessonov send x-hasura-lang header from client and configure SELECT permissions in console based on x-hasura-lang