Skip to content

Types seem to be outdated #7

@LuisEnMarroquin

Description

@LuisEnMarroquin

I am writting a very simple TypeScript HTTP API behind API Gateway

import { APIGatewayProxyHandler } from "aws-lambda"

export const myFunction: APIGatewayProxyHandler = async (event) => {
  console.log('event', event)
  console.log(event.rawQueryString) // Property 'rawQueryString' does not exist on type 'APIGatewayProxyEvent'
}

It says that rawQueryString doesn't exist

image

But when I log event I see that it exists in CloudWatch

{
  version: '2.0',
  routeKey: 'GET /',
  rawPath: '/',
  rawQueryString: 'xdddd=1223&xyyyyy=5667',
  headers: {
    accept: '*/*',
    'accept-encoding': 'gzip, deflate, br',
    'content-length': '0',
    host: 'api.example.com',
    'x-forwarded-for': 'XXX.XXX.XXX.XXX',
    'x-forwarded-port': '443',
    'x-forwarded-proto': 'https'
  },
  queryStringParameters: { xdddd: '1223', xyyyyy: '5667' },
  requestContext: {
    accountId: '123451234512',
    apiId: '35453sdfs354',
    domainName: 'api.example.com',
    domainPrefix: 'api',
    http: {
      method: 'GET',
      path: '/',
      protocol: 'HTTP/1.1',
      sourceIp: 'XXX.XXX.XXX.XXX',
      userAgent: 'PostmanRuntime/7.28.4'
    },
    requestId: 'XXXXXXXXXXXXX',
    routeKey: 'GET /',
    stage: '$default',
    time: '28/Apr/2022:17:07:28 +0000',
    timeEpoch: 16541656384673
  },
  isBase64Encoded: false
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions