{"id":13880924,"url":"https://github.com/dabit3/graphql-api-cdk-serverless-postgres","last_synced_at":"2025-11-17T15:21:28.609Z","repository":{"id":54145985,"uuid":"312132322","full_name":"dabit3/graphql-api-cdk-serverless-postgres","owner":"dabit3","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-08T01:39:01.000Z","size":466,"stargazers_count":58,"open_issues_count":3,"forks_count":34,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-09T09:58:58.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dabit3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-12T01:13:29.000Z","updated_at":"2024-10-01T20:07:13.000Z","dependencies_parsed_at":"2022-08-13T07:31:30.465Z","dependency_job_id":null,"html_url":"https://github.com/dabit3/graphql-api-cdk-serverless-postgres","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dabit3/graphql-api-cdk-serverless-postgres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fgraphql-api-cdk-serverless-postgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fgraphql-api-cdk-serverless-postgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fgraphql-api-cdk-serverless-postgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fgraphql-api-cdk-serverless-postgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dabit3","download_url":"https://codeload.github.com/dabit3/graphql-api-cdk-serverless-postgres/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fgraphql-api-cdk-serverless-postgres/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284907413,"owners_count":27082837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-17T02:00:06.431Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T08:03:39.979Z","updated_at":"2025-11-17T15:21:28.593Z","avatar_url":"https://github.com/dabit3.png","language":"TypeScript","readme":"# CDK API with GraphQL and Aurora Serverless PostgreSQL\n\nThis CDK stack deploys a real-time GraphQL API built with AWS AppSync, Amazon Aurora Serverless PostgreSQL, and AWS Lambda.\n\n![CDK API with GraphQL and Aurora Serverless PostgreSQL](header.jpg)\n\n## Getting started\n\nTo deploy this project, follow these steps.\n\n1. Clone the project\n\n```sh\ngit clone https://github.com/dabit3/graphql-api-cdk-serverless-postgres.git\n```\n\n2. Change into the new directory and install dependencies\n\n```sh\ncd graphql-api-cdk-serverless-postgres\n\nnpm install\n```\n\n3. Change into the __lambda-fns__ directory and install the dependencies for the Lambda function package:\n\n```sh\ncd lambda-fns\nnpm install\ncd ..\n```\n\n4. Run the build\n\n```sh\nnpm run build\n```\n\n5. Deploy the stack\n\n```sh\ncdk deploy --O cdk-exports.json\n```\n\n6. Create the posts table\n\nVisit the [RDS dashboard](https://console.aws.amazon.com/rds/home) and click on __Query Editor__. From the dropdown menu, choose the database (it should begin with __appsynccdkrdsstack-aurorablogcluster__).\n\nFor the Database username, choose __Connect with a Secrets Manager ARN__.\n\nTo sign in, you will need the ARN from the secret that was created by CDK. To get this secret, in a new window open [AWS Secrets manager](https://console.aws.amazon.com/secretsmanager/home). Here, click on the secret that was created by CDK (it should start with __AuroraBlogClusterSecret__). Copy the Secret ARN to your clipboard and go back to the RDS Query Editor.\n\nNext, use the __Secret ARN__ as the __Secrets Manager ARN__ and __BlogDB__ as the name of the database. Next, press enter and click on Connect to Database.\n\nOnce signed in, create the __posts__ table by executing the following query:\n\n```sql\nCREATE TABLE posts (\n id text UNIQUE,\n title text,\n content text\n);\n```\n\n7. Testing the API\n\nNext, visit the [AppSync console](https://console.aws.amazon.com/appsync/home) and click on __cdk-blog-appsync-api__ to view the dashboard for your API.\n\nNext click on __Queries__ in the left hand menu to view the query editor. From here, we can test out the API by running the following queries and mutations:\n\n```graphql\nmutation createPost {\n  createPost(post: {\n    id: \"001\"\n    title: \"My first post!\"\n    content: \"Hello world!\"\n  }) {\n    id\n    title\n    content\n  }\n}\n\nquery listPosts {\n  listPosts {\n    id\n    title\n    content\n  }\n}\n\nquery getPostById {\n  getPostById(postId: \"001\") {\n    id\n    title\n    content\n  }\n}\n\nmutation updatePost {\n  updatePost(post: {\n    id: \"001\"\n    title: \"My updated post!\"\n  }) {\n    id\n    title\n  }\n}\n\nmutation deletePost {\n  deletePost(postId: \"001\")\n}\n```","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabit3%2Fgraphql-api-cdk-serverless-postgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdabit3%2Fgraphql-api-cdk-serverless-postgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabit3%2Fgraphql-api-cdk-serverless-postgres/lists"}