Slash Lambda with Packages

Dgraph GraphQL Lambda Overview docs state:

Webpack is required to use the sample rank() function.

This seems to jive with dgraph/dgraph-lambda readme on Github

If you would like to add libraries, then use webpack --target=webworker to compile your script. We’ll fill out these instructions later.

I believe “these instructions” refer to compiling the lambda script with webpack. I believe Slash does this compiling for us already.

So… what packages can we import? Anything on npm? A list of approved packages? I would probably be able to answer this myself if I knew more about webpack and didn’t rely on React magic.

For instance, currently I am wanting to make some queries to the Google Maps API, which requires Axios for the requests…

This is something I ran into today as well. I tried importing 'markdown-it' in my lambda script on Slash and it turns out to be an error

Yeah, you have to compile it if you want to import any packages. There is no current examples how to do this still though.

1 Like

Ugh. Now I am gonna see if I can get away without installing any nodejs on my pristine-untouched-by-js computer.

@amaster507 You did the auth thing with a @custom on netlify… is netlify free or do I have to pay?

It has a free tier. Can’t remember how many calls per month you get but it is a fair amount. AWS also has a free tier for lambdas I believe.

1 Like