With a new Lambda function comes the need to deploy our code, which requires a full deployment via sls deploy. As a reminder, any time you add, remove, or otherwise update an AWS resource, a complete CloudFormation update is needed. We need to add a couple of new entries in the serverless.yml file, which will call the new graphql handler functions:
functions:
GraphQL:
handler: handler.graphql
events:
- http:
path: graphql
method: get
cors: true
- http:
path: graphql
method: post
cors: true
GraphQL will accept both GET and POST requests, so we'll wire methods to the same /graphql endpoint and make sure we enable CORS.
Since we're using new libraries, Graphene and Graphene-SQLAlchemy, we'll need to update our requirements file and rebuild our supporting...