AWS AmplifyのGraphQL APIでAPI keyを使う
2023/4/1 6:18:00
import awsExports from './aws-exports';
const graphql_result = await API.graphql({
query: listPostByUpdatedAtWhereStatus,
variables: {
status: Post_Status.LIVE,
sortDirection: ModelSortDirection.DESC,
limit: 20
},
authMode: "API_KEY",
authToken: awsExports.aws_appsync_apiKey
}) as GraphQLResult<ListPostByUpdatedAtWhereStatusQuery>
listPostByUpdatedAtWhereStatus
とListPostByUpdatedAtWhereStatusQuery
は良きように変える。