How can I create a resolver that adds data from another DocumentDB collection to each item within the query response list?
Given the grossly overly simplified following schema:
type Asset {
id: ID!
...
}
type DeviceData {
id: ID!
assetID: string
asset: Asset
...
}
Query {
findDevicesQuery: [DeviceData]
}
For example, findDevicesQuery() => currently returns all devices
I now need to get the associated asset for each device by assetID and then append it to the findDevicesQuery response for each device
ie:
findDevicesQuery => returns
[
{deviceData1, associatedAssetData1},
{deviceData2, associatedAssetData2},
{deviceData3, associatedAssetData3}
]
I would've done this with a connection in Amplify using DynamoBD, however this project is not using Amplify, it is using DocumentDB.