I've got the following use case I want to solve with AWS AppSync:
- Client sends GraphQL query
saved(username: String) - AppSync sends query to an HTTP endpoint which returns a list of items:
{"items": ["a", "b"] } - For each of these items (a,b) AppSync sends a query to an HTTP endpoint which returns details for the items. I.e.
{"images": ["1.jpg", "2.jpg"], "panoramas": ["1a.jpg"]} - This should be combined to an response:
{"saved": [{"images": ["1.jpg", "2.jpg"], "panoramas": ["1a.jpg"]}, {"images": ["11.jpg", "22.jpg"], "panoramas": ["1b.jpg"]}]}
schema:
type Query {
saved(username: String!): [Detail]
}
type Detail {
images: [String]
panoramas: [String]
}
The HTTP enpoints are fairly simple:
GET /users/$username/saved/
GET /details/$itemid/
I've looked into Pipeline resolvers but couldn't get anything working. Also I tried to attach a resolver directly to "Detail" which is not possible. It seems that I lack some basic understanding of AppSync here. Can you point me to the right direction?