Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Error GET/POST requests missing with Lambda Handler #332

Closed
nenti opened this issue Mar 21, 2017 · 7 comments
Closed

Error GET/POST requests missing with Lambda Handler #332

nenti opened this issue Mar 21, 2017 · 7 comments

Comments

@nenti
Copy link

nenti commented Mar 21, 2017

I'm running into an Error running this plugin with a serverless setup as follow:

functions:
  api:
    handler: graphql.graphqlHandler
    events:
    - http:
        path: graphql
        method: POST
        cors: true
        integration: lambda
    - http:
        path: graphql
        method: GET
        cors: true
        integration: lambda

There seems to be missing a proper handling of API-Gateway + Lambda setup.

@nenti nenti changed the title Error GET/POST requests missing with Serverless Framework Error GET/POST requests missing with Lambda Handler Mar 21, 2017
@soda0289
Copy link
Contributor

Can you post some code to reproduce the problem. I have not tested it with serverless but it should work as expected.

What error are you getting? Is it in cloudwatch or with serverless deploy?

@soda0289
Copy link
Contributor

Taking a look at your config you might be using the incorrect integration. Delete the line integration: lambda as the default is lambda proxy and you have it set to lambda, which I don't think are the same.

@soda0289
Copy link
Contributor

You can also explicitly set integration: lambda-proxy as that should work as well.

@nenti
Copy link
Author

nenti commented Mar 22, 2017

Nice! That seems to have fixed it for me. Maybe you could add that to your example cloudformation config. This would have saved me hours of frustration. 👍

@soda0289
Copy link
Contributor

I will add another example for serverless as it seems to be the more popular choice.

@nenti
Copy link
Author

nenti commented Mar 22, 2017

You can use mine if you want:

functions:
  api:
    handler: graphql.graphqlHandler
    events:
    - http:
        path: graphql
        method: POST
        cors: true
        integration: lambda-proxy
    - http:
        path: graphql
        method: GET
        cors: true
        integration: lambda-proxy

  graphqli:
    handler: graphql.graphiqlHandler
    events:
    - http:
        path: graphiql
        method: GET
        cors: true

@blackxored
Copy link

lambda-proxy is the default so you shouldn't need to explicitly add that.

@soda0289 soda0289 mentioned this issue Jun 16, 2017
4 tasks
@helfer helfer closed this as completed Jun 28, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants