Greater access to request and response in functions #270
Description
Issue by lastmjs
Friday Oct 13, 2017 at 22:06 GMT
Originally opened as https://github.com/graphcool/prisma/issues/806
I would like to replace AWS Lambda functions entirely with graph.cool functions, since graph.cool functions are a lot easier to deal with with much less configuration, and the environment is much more tightly integrated with my entire application architecture, which is just using GraphQL for almost all server-side functionality. I'm missing a couple features that are keeping me from completely moving away from AWS:
- Access to the full request body in a function
- Ability to set headers or otherwise manipulate the response from a function (for example, to set cookies or set a 302 redirect on the client)
My specific use case is with LTI, an authentication method for education applications. The protocol requires a server to be listening for a post request from a client, and the post request is validated using public/private key cryptography. Once the request is validated, some stuff happens and eventually I return a response with some cookies set and a 302 redirect, so that the client is redirected to my application (they came from another source, usually their Learning Management System).
I've got a potential work-around with AWS API Gateway. I'll just map the incoming post request to a graph.cool post request, and a resolver function will take over from there. I'll also map the response from AWS API Gateway to add the headers that I need. But ideally, I wouldn't even need to deal with any of that hoopla.