type Query getPost(id: ID!): Post listPosts(limit: Int, nextToken: String): PostConnection!
amplify init amplify push # Run GraphQL codegen (types, operations) npm run codegen Start local AppSync emulator (using Amplify Mock) amplify mock api Run unit tests for resolvers npm test GraphQL Schema The schema is defined in schema.graphql . Example:
type Subscription onPostCreated: Post @aws_subscribe(mutations: ["createPost"]) appsync repo
type Mutation createPost(input: CreatePostInput!): Post @aws_cognito_user_pools
cd infra npm run cdk deploy
This API uses multiple authorization modes (configured per field/type):
type Query publicFeed: [Post] @aws_api_key type Query getPost(id: ID
type Mutation createPost(input: CreatePostInput!): Post updatePost(id: ID!, input: UpdatePostInput!): Post deletePost(id: ID!): Boolean