I have a working function now…at least it works in the shell:
Query(
Lambda(
["inputdata"],
Let(
{ dataIds: Select("ids", Var("inputdata")) },
Union(
Map(
Var("dataIds"),
Lambda(
["id"],
Select(
["data"],
Paginate(
Match(
Index("certificate_by_dealer"),
Ref(Collection("Dealers"), Var("id"))
)
)
)
)
)
)
)
)
)
This works in the Shell of the dashboard but returns an error in GraphQL:
{
"errors": [
{
"message": "Lambda expects an array with 1 elements. Array contains 4.",
"extensions": {
"code": "invalid argument"
}
}
]
}
Here is the shell Call:
Call("user_dealers_all_certificates", {ids: ["302122229239382536", "301394099049595400"]})
[
Ref(Collection("Certificate"), "302122488174739977"),
Ref(Collection("Certificate"), "302132509580198413"),
Ref(Collection("Certificate"), "302120872550859273")
]
and the GraphQL query:
query {
allUserDealersCertificate(data: {ids: "302122229239382536"}){
data {
_id
}
}
}
and relevant schema:
allUserDealersCertificate(
data: allUserDealersCertificateInputs
): [Certificate]
@resolver(name: "user_dealers_all_certificates", paginated: true)
input allUserDealersCertificateInputs {
ids: [ID!]!
}
I have posted this issue in a few locations, so hopefully it can get resolved. Thanks.