Closed j-waaang closed 5 years ago
Solved this by passing the parameters in additional parameters instead and using the name queryParams
--additional-params "{\"queryParams\":{\"offset\":\"10\"}}"
However the readme of this project says to put the querystring inside the params. Is this a mistake?
params The API params (path, header, querystring, etc) as a JSON string. Defaults to '{}'.
Yeah you might be right there. It should be passed through the additional-params
. Thanks for letting us know.
Please can you add a simple example like this to the readme for queryParams? Had to search here after struggling in pain for a bit :)
Hey I'm trying to pass query parameters to the request. After looking up the aws amplify docs I've come up with this which unfortunately doesn't work.
--params "{\"queryStringParameters\":{\"offset\":\"10\"}}"
The event my lambda function recieves still has no query parameters
queryStringParameters: null,
Simply entering my api url into the browser and adding
?offset=10
works.queryStringParameters: { offset: '10' },
So I guess my setup in serverless.yaml should be correct. And I'm entering the parameters wrong inside my console. I'm using cmd on windows btw.