This is due to a change we did for performance improvement in GraphQL. Previously, we would be selecting entire rows, no matter now many fields you wanted from a table. Now, we are only selecting exactly what you ask for. However, if you ask for nothing, you get nothing. Therefore, you cannot have join-only fields in the schema, such as here:
taxAndAccountingGroup {
items {
joindown_TaxAndAccountingInformation_via_TaxAndAccGroup {
items {
joinup_TaxCode_via_TaxCodeSales {
joinup_Vat {
rate
}
}
}
}
As you figured it out, it works, if you add at least one field. But you did that do that with joinup_TaxCode_via_TaxCodeSales.
Here is a query that works:
query GetTaxAndAccountGroups($cid: Int!) {
useCompany(no : $cid) {
taxAndAccountingGroup {
totalCount
items {
taxAndAccountingGroupNo
description
joindown_TaxAndAccountingInformation_via_TaxAndAccGroup {
totalCount
items {
taxAndAccountingGroup
description
joinup_TaxCode_via_TaxCodeSales {
taxCode
joinup_Vat {
rate
}
}
}
}
}
}
}
}
Result:
{
"data": {
"useCompany": {
"taxAndAccountingInformation": {
"totalCount": 8,
"items": [
{
"taxAndAccountingGroup": 1,
"description": "Avgiftspliktig høy sats",
"joinup_TaxCode_via_TaxCodeSales": {
"taxCode": 3,
"description": "Utgående MVA - høy sats",
"joinup_Vat": {
"rate": 25
}
}
},
{
"taxAndAccountingGroup": 2,
"description": "Avgiftsfritt",
"joinup_TaxCode_via_TaxCodeSales": {
"taxCode": 4,
"description": "Avgiftsfritt salg innland",
"joinup_Vat": null
}
},
... Mostrar más