craftql
craftql copied to clipboard
Related entries are not being returned
Craft 3.1.17.2 CraftQL 1.3.1
I am using entriesConnection
to query a given entry by its id and then use relatedEntries
to get reverse related entries from a given section. This has worked in the past, but right now this query is returning an empty object for my relatedEntries
part.
Here's the full query:
query getScript($id:[Int]) {
entriesConnection(id:$id) {
edges {
node {
...on Scripts {
id
title
postDate
expirationDate
diagnosis
client { id title url }
veterinarian { id title url }
sites { id title url }
replaces { id title url }
drugsMatrix {
...on DrugsMatrixFormulaItem {
__typename
drug { id title url }
unitOfMeasure_FieldData { selected { label } }
outOfStock
replacedBy { id title url }
}
}
}
}
orders: relatedEntries(section:orders) {
edges {
node {
...on Orders {
id
title
}
}
}
}
}
}
}
Everything returns fine except orders
just returns the following:
"orders": {
"edges": []
}
But I know for a fact this entry is related to 12 different Order entries.