I have the following:
Custom resolver function:
Query(
Lambda(
"data",
Let(
{
cId: Select("cId", Var("data")),
itemIds: Select("itemIds", Var("data"))
},
Update(Ref(Collection("collections"), Var("cId")), {
data: {
items: Map(
Var("itemIds"),
Lambda("id", Ref(Collection("cart_items"), Var("id")))
)
}
})
)
)
)
Mutation schema:
input UpdateCollectionItemsInput {
cId: ID!
itemIds: [ID!]!
}
type Mutation {
updateCollectionItems(data: UpdateCollectionItemsInput!): Collection @resolver(name: "update_collection_items")
}
And running the following in Graphql Playground:
mutation UpdateCollectionItems($data: UpdateCollectionItemsInput!) {
collection: updateCollectionItems(data: $data) {
_id
}
}
With the following params:
{
"data": {
"cId": "289714644730249734",
"itemIds": ["289715074820473350"]
}
}
However, I keep getting the following error:
{
"errors": [
{
"message": "Value not found at path [cId].",
"extensions": {
"code": "value not found"
}
}
]
}
The same code seems to work fine when I run it via Shell:
Call("update_collection_items", {
cId: "289714644730249734",
itemIds: ["289715074820473350"]
})