Xamarin.Forms+AppSync(+Lambda)を実行するサンプル
type GetSampleData {
message: String
hoge: String
fuga: String
piyo: String
foo: Int
bar: Int
}
type GetSampleResponse {
result: LambdaResult
data: GetSampleData
}
type LambdaResult {
status_code: Int
}
type Query {
GetSample(name: String): GetSampleResponse
}
schema {
query: Query
}
#**
The value of 'payload' after the template has been evaluated
will be passed as the event to AWS Lambda.
*#
{
"version" : "2017-02-28",
"operation": "Invoke",
"payload": $util.toJson($context.args)
}
$util.toJson($context.result)
import json
def lambda_handler(event, context):
# TODO implement
print(event)
result = {
"status_code": 200
}
data = {
"message": 'Hello {0}!!!'.format(event['name']),
"hoge": "abc",
"fuga": "あいう",
"piyo": "xyz",
"foo": 123,
"bar": 456
}
ret = {
"result": result,
"data": data
}
return ret