Skip to content

0.19 Variable Map injection broken by replaceAll #126

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
katesclau opened this issue Aug 28, 2021 · 1 comment
Closed

0.19 Variable Map injection broken by replaceAll #126

katesclau opened this issue Aug 28, 2021 · 1 comment

Comments

@katesclau
Copy link
Contributor

Describe the bug
replaceAll is not a supported function. We need to fall back to replace with RegExp.

TypeError: statmnt.replaceAll is not a function
    at .../node_modules/serverless-appsync-simulator/lib/data-loaders/RelationalDataLoader.js:129:20

To Reproduce
Create a Query on and RDS Data source with variableMap

{
  "version": "2018-05-29",
  "statements": [
    "SELECT :VALUE"
  ],
  "variableMap": {
      ":VALUE": "$ctx.args.value"
  }
}

Run it and watch it break.

Expected behavior
The query returns the value in the response $ctx.result

@katesclau
Copy link
Contributor Author

Another solution to this, is upgrading to NodeJS >v15

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant