Accessing AWS DynamoDB through Apollo GraphQL Server deployed in AWS Lambda through Server

Accessing AWS DynamoDB through Apollo GraphQL Server deployed in AWS Lambda through Server

Accessing AWS DynamoDB through Apollo GraphQL Server deployed in AWS Lambda through Serverless. Objective: Fetch all records of a DynamoDB table through a GraphQL lambda function. Technologies used: AWS DynamoDB, AWS Lambda, AWS IAM, Serverless, Apollo Graphql.

Objective: Fetch all records of a DynamoDB table through a GraphQL lambda function.

Query:

query {
quotes {
  id
  value
  source
 }
}
Response:
{
  "data": {
    "quotes": [
      {
        "id": "q2",
        "value": "If you don’t like how things are, change it! You’re not a tree.",
        "source": "Jim Rohn"
      },
      {
        "id": "q1",
        "value": "Start with the end in mind.",
        "source": "Stephen Covey"
      }
    ]
  }
}

Technologies used: AWS DynamoDB, AWS Lambda, AWS IAM,  Serverless,  Apollo Graphql

Prerequisite: Basic knowledge of AWS and Intermediate level knowledge of JavaScript, and Apollo Server.

STEP 1 — Create a DynamoDB table

First, create a table named Quote _in  DynamoDB with Primary Key _id.

Create DynamoBD table

Add some entries to the table through C_reate item. You can use the below sample JSON text (instead of the _Tree option on the dropdown)

serverless apollo-server aws aws-lambda

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Serverless Express – Easy APIs On AWS Lambda & AWS HTTP API

Serverless Express enables you to easily host Express.js APIs on AWS Lambda and AWS HTTP API. Here is how to get started and deliver a Serverless Express.js based API with a custom domain, free SSL certificate and much more!

Deploying an Apollo GraphQL Application As An AWS Lambda Function Through Serverless

This article is in continuation of Deploying an Apollo GraphQL Application As An AWS Lambda Function Through Serverless. Wherein we built a minimalistic application to pull AWS DynamoDB data from a locally hosted Graphql server.

Adding Code to AWS Lambda, Lambda Layers, and Lambda Extensions Using Docker

Adding Code to AWS Lambda, Lambda Layers, and Lambda Extensions Using Docker. With Docker, we have three ways to add code to Lambda that isn’t directly part of our Lambda function. Try to AWS Lambda, Lambda Layers, and Lambda Extensions Using Docker.

Serverless Proxy with AWS API Gateway and AWS Lambda

Serverless Proxy with AWS API Gateway and AWS Lambda. We can communicate between Public and Private instance via a Serverless Proxy thanks to AWS Api Gateway and AWS Lambda. Github Webhook calls a Public API Gateway, API Gateway triggers a Lambda attached to VPC.

Serverless Framework: Use AWS S3 Object Lambda to Resize Images on The Fly

Serverless Framework: Use AWS S3 Object Lambda to resize images on the fly. I will show you how to use AWS S3 Object Lambda to resize images on the fly. The Serverless Framework will be used to define the Infrastructure as Code and to simplify the deployment.