I understand that ideally, you'd want something like this:
query read_texts($cid : Int!, $orderNo : Int)
{
useCompany(no : $cid)
{
order(filter :{orderNo :{_eq : $orderNo}})
{
items
{
orderNo
deliveryMethod
deliveryMethod_Text(lang : NORWEGIAN) {
text
}
paymentMethod
paymentMethod_Text(lang : NORWEGIAN) {
text
}
}
}
}
}
This API is a generic one, built dynamically from the data model. Providing joins to the text table for some particular fields in this fashion is not possible, because there are no join relationships defined between these tables (such as Order in the previous example) and the Text table. As a result, we cannot provide a generic way for making this happen.
However, you can read this using two (or multiple requests), using the @export directive (and aliases). Here is an example:
query read_texts($cid : Int!,
$orderNo : Int,
$dm : Long = 0,
$pm : Long = 0)
{
useCompany(no : $cid)
{
order(filter :{orderNo :{_eq : $orderNo}})
{
items
{
orderNo
deliveryMethod @export(as :"dm")
paymentMethod @export(as : "pm")
}
}
deliveryMethodName : text(filter: {
languageNo :{_eq : 47} # Norwegian
textType : {_eq : 5} # delivery method
textNo : {_eq : $dm}
})
{
items
{
text
}
}
paymentMethodName : text(filter: {
languageNo :{_eq : 47} # Norwegian
textType : {_eq : 7} # payment method
textNo : {_eq : $pm}
})
{
items
{
text
}
}
}
}
This has been documented here: https://docs.business.visma.net/docs/howto/texts
... View more