Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lambda-invoke-debug

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-invoke-debug

Invoke a running lambda function while debugging.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

lambda-invoke-debug

Invoke a locally running lambda function while debugging.

Credit

This project takes inspiration from Amplify CLI specifically the mocking functionality and how it invokes a local lambda function.

Purpose

The purpose of this project is to serve a graphql schema and relay the requests to a locally running lambda function for the purpose of debugging.

Supported lambda runtime Go

go

Dependencies

Go

Node

Install

npm install lambda-invoke-debug

Local install

  1. Clone the repo
  2. npm install
  3. (optional) npm link will add lid command to your cli or within the project run npm run start

Usage

Run lid serve <graphql schema file> <config file>

Example

lid serve ~/project/schema.graphql ~/project/config.js

Config

The config file is a javascript module that is loaded dynamically at runtime. This file should look like

module.exports = {
    /*
        type Query {
            GetAccount(input: AccountGetInput!): Account
        }
    */
   // the name of the field in the schema
    GetAccount : {
        // the name of the process running your code
        // for go debug process we use
        debugProcess: '__debug_bin',
        // a distinctive name in the file path to your code
        // example ~/projects/myGraph/backend/functions/Account/src/main.go
        // 'Account' is in the path and unique name that I can use to identify this function for my field
        functionName: 'Account',
        // the payload you want to mock and send to your function
        // you can also return a promise
        payload: (args, request, field) => ({
            typeName: field.operation.operation,
            fieldName: field.fieldName,
            arguments: JSON.stringify(args, null)
        })
    }
}

FAQs

Package last updated on 02 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc