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.

unable to view playground after deployed into aws lambda using serverless (apollo-server-lambda)

See original GitHub issue

Hi, recently i have deployed my apollo graphql server into aws lambda using serverless. i used apollo-server-lambda package for that.

after deployment, i am able to do query and mutations and i am getting fair response from my graphql endpoint https://3drjwyz1z8.execute-api.us-east-1.amazonaws.com/dev/graphql

my problem is, i am unable to view graphiql playground from my browser. i tried a lot but nothing helped me. i am getting below error while i am hitting the endpoint from browser to view playground.

{
message: "Internal server error"
}

i have allowed cors, any header and so on. they only problem is with playground. i set playground:true too.

const server = new ApolloServer({
  schema,
  context,
  playground: true,
  introspection: true,
});

nothing helping me. i want to display the playground to the users if they hit from browser, then only they can view the gql types and schema design.

kindly guide me how to address this issue.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
duong-secommented, Jun 8, 2020

image I can run this on serverless-offline but after deploy to lambda it always shows me Internal Server Errors without error log on cloud watch. Does anybody face with this problem?

1reaction
arthurandradecommented, Feb 29, 2020

I had this same problem!

to solve it, in my serveless.yml, I add it

    handler: graphql.handler
    events:
    - http:
        path: graphql
        method: POST
        cors: true
    - http:
        path: graphql
        method: GET
        cors: true
    - http:
        path: playground
        method: ANY
        cors: true

and to access the playground I used this url https://......amazonaws.com/dev/playground

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying with AWS Lambda - Apollo GraphQL Docs
Setting up a project to work with Lambda isn't that different from a typical NodeJS project. First, install the apollo-server-lambda package:.
Read more >
Debug Apollo Server as AWS Lambda Function - Stack Overflow
Check your lambda function's Cloudwatch logs on AWS; Run serverless ... (see outDir in tsconfig.json ), and then runs serverless deploy :.
Read more >
How to Build a Serverless Apollo GraphQL Server with AWS ...
We are going to deploy our Apollo Server on to Amazon Web Services (AWS). Create an AWS account if you don't already have...
Read more >
apollo-server-lambda - npm
Production-ready Node.js GraphQL server for AWS Lambda. Latest version: 3.11.1, last published: 2 months ago. Start using ...
Read more >
Deploy an Apollo GraphQL Server with Amplify Functions
We'll be using the apollo-server-lambda package to make this even ... If you're interested in deploying a serverless GraphQL API using AWS ......
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