I am exploring how to implement multi-language strings as this is a big part of my database. I have come across the Get Started with Dgraph - Multi-language strings tutorial which shows a nice solution to this.
I am new to creating back end GraphQL schemas and Dgraph, soI likely have am missing some knowledge or have a misunderstanding of how this could work.
From what I can understand the @lang is a Dgraph specific directive and doesn’t belong to native GraphQL. With this in mind, is it possible to use the Lamdba functions to resolve a query that can use these Dgraph enhancements?
As a very basic example, I am trying to achieve the following:
type Entry {
id: ID!
title: String!
description: String!
}
Where both title and description are multi-language fields. And to get the correct result I could query:
query MyQuery {
getEntry(id: "123", lang: "en") {
title
description
}
}
And in the lambda function it would return the correct title@en
, description@en
etc.
Is this possible?