Skip to content

Instantly share code, notes, and snippets.

View proton0210's full-sized avatar
🛠️
Making Serverless Applications on AWS

Vidit Shah proton0210

🛠️
Making Serverless Applications on AWS
View GitHub Profile
@proton0210
proton0210 / package.json
Created December 29, 2021 17:11
cdk app package.json gile
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/core": "10.0.27",
"@emotion/styled": "10.0.27",
"@testing-library/jest-dom": "4.2.4",
"@testing-library/react": "9.3.2",
"@testing-library/user-event": "7.1.2",
npm i @aws-sdk/client-dynamodb @aws-sdk/util-dynamodb @types/aws-lambda esbuild ulid
NEXT_PUBLIC_USER_POOL_ID=
NEXT_PUBLIC_USER_POOL_CLIENT_ID=
NEXT_PUBLIC_FLIGHTS_TABLE=
NEXT_PUBLIC_SEATS_TABLE=
NEXT_PUBLIC_AWS_ACCESS_KEY_ID=
NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY=
NEXT_PUBLIC_API_END_POINT=
NEXT_PUBLIC_AWS_REGION=
jest.config.js
module.exports = {
testEnvironment: "node",
roots: ["<rootDir>/__tests__"],
testMatch: ["**/*.test.ts"],
transform: {
"^.+\\.tsx?$": "ts-jest",
},
testTimeout: 90000,
import * as dotenv from "dotenv";
dotenv.config();
import { DynamoDB } from "@aws-sdk/client-dynamodb";
import { marshall } from "@aws-sdk/util-dynamodb";
const region_name = "ap-south-1";
// Initialize DynamoDB client
const dynamodb = new DynamoDB({
region: region_name,
import * as dotenv from "dotenv";
dotenv.config();
import { DynamoDB } from "@aws-sdk/client-dynamodb";
import { marshall } from "@aws-sdk/util-dynamodb";
const region_name = "ap-south-1";
// Initialize DynamoDB client
const dynamodb = new DynamoDB({
region: region_name,
module.exports = {
testEnvironment: "node",
roots: ["<rootDir>/__tests__/test_cases"],
testMatch: ["**/*.test.ts"],
transform: {
"^.+\\.tsx?$": "ts-jest",
},
testTimeout: 90000,
};
type User {
id: ID!
name: String!
email: String!
}
type Todo {
TodoID: ID!
UserID: ID!
title: String!
Link : https://github.com/proton0210/api-frontend
NEXT_PUBLIC_USER_POOL_ID=xx
NEXT_PUBLIC_USER_POOL_CLIENT_ID=xx
NEXT_PUBLIC_GRAPHQL_ENDPOINT=xx
NEXT_PUBLIC_REGION=ap-south-1
NEXT_PUBLIC_AWS_ID=xx
NEXT_PUBLIC_AWS_SECRET=xx
NEXT_PUBLIC_APIGATEWAY_ENDPOINT=xx
appsync-todo-operaton.test.ts
"graphql": "jest --verbose ./__tests__/test_cases/e2e/appsync-todo-operaton.test",
const createTodoMutation = `mutation CreateTodo($input: CreateTodoInput!) {
createTodo(input: $input) {
UserID
TodoID
title
completed
}