question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Example running apollo-server-lambda on zeit now

See original GitHub issue

I’m wondering if anyone has successfully run apollo-server-lambda on zeit now v2.

When I copy and paste the simple hello world example from apollo-server-lambda’s docs I’m getting this error:

TypeError: "listener" argument must be a function

I then see it’s specifically for vanilla lambdas on AWS and has a exports.handler = … rather than module.exports = … as is common on zeit now. However, as you’d expect switching to the latter doesn’t work either and produces:

UnhandledPromiseRejectionWarning: TypeError: callback is not a function

Does anyone have any thoughts on getting this to run?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
controversialcommented, Jul 9, 2019

Worth noting that the docs at docs/source/deployment/now.md still refer to Now v1

4reactions
heymartinadamscommented, Apr 15, 2020

Thanks to your assistance, @notrab, was able to get it to work with CORS. Afterwards, in a moment of utter ‘duh’-ness, I realized I didn’t have to use CORS in the first place if I have both the client and server in the same project using Now. 😂 (I had been so indoctrinated to keep those two parts separate, it didn’t even occur to me to integrate them into the same project.)

Adding this to the general knowledge base: https://medium.com/ecstatic-engineering/how-to-deploy-a-graphql-server-with-prisma-to-a-serverless-platform-49c573e9b26e

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying with AWS Lambda - Apollo GraphQL Docs
For this example, we'll start from scratch to show how all the pieces fit together. Begin by installing the necessary packages for using...
Read more >
apollo-server-lambda | Yarn - Package Manager
apollo -server-lambda : This package is now implemented as a wrapper around apollo-server-express . createHandler 's argument now has different options:.
Read more >
How to deploy Next.js with GraphQL backend on Zeit Now?
... complete example of Next.js/Apollo GraphQL running both on Zeit Now (as serverless function/lambda) and Heroku (with an Express server):.
Read more >
How to Build a Serverless Apollo GraphQL Server with AWS ...
Now we've got our Apollo Server implemented with TypeScript, but how do we “run” the Server? Unlike “traditional” servers, you cannot simply run...
Read more >
How to deploy an Apollo GraphQL server running in AWS ...
This video shows how to deploy an Apollo GraphQL server running in a Lambda function on AWS using AWS Amplify Functions and connect...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found