question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Localization (l11n) strategy with Hasura for getting data in given locale

See original GitHub issue

Hi, 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:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

10reactions
barbaraDoramecommented, May 29, 2020

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

1reaction
pronevichcommented, Oct 14, 2020

@Bessonov send x-hasura-lang header from client and configure SELECT permissions in console based on x-hasura-lang

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found