Alex Price
06/17/2021, 3:28 PMauthorisationType
, but I can't see it mentioned for AppSync.Alex Price
06/17/2021, 3:44 PMFrank
Alex Price
06/17/2021, 4:22 PMAlex Price
06/17/2021, 4:23 PMFrank
Alex Price
06/17/2021, 4:24 PMFrank
Alex Price
06/17/2021, 4:43 PMResolvableField
which I assume has been abstracted away by SST 😕
(edit: can't find ResolvableField
in SST codebase)Alex Price
06/17/2021, 4:45 PMFrank
import * as appsync from "@aws-cdk/aws-appsync";
// Creates AppSync API
const api = new sst.AppSyncApi(this, "GraphqlApi", {
dataSources: {
mainDS: "src/notes.main",
},
});
// Add a resolvable field
api.graphqlApi.addMutation('setStatus', new appsync.ResolvableField({
returnType: appsync.GraphqlType.string(),
args: {
id: appsync.GraphqlType.string(),
},
dataSource: api.getDataSource("mainDS"),
directives: [
appsync.Directive.cognito()
]
}));
So you use sst.AppSyncApi
to create the dataSources first. And then add the resolvable field.Frank
Frank