a custom query
const schema = a.schema({
echo: a
.query()
.arguments({ content: a.string() })
.returns(a.ref('EchoResponse'))
.authorization(allow => [allow.publicApiKey()])
// 3. set the function has the handler
.handler(a.handler.function(echoHandler)),
EchoResponse: a.customType({
content: a.string(),
executionDuration: a.float()
}),
});
Use a custom query to define an API request that will retrieve backend data.