aws-amplify / aws-amplify/amplify-data

Set cookies in lambda resolver

Open
#492 1 comment 2 reactions 0 assignees View on GitHub
feature-request GraphQL
Dominant language
TypeScript
Stars
18
Forks
23
Avg merge
26m
Merged PRs (30d)
1

Description

### Is this related to a new or existing framework?

_No response_

### Is this related to a new or existing API?

GraphQL API

### Is this related to another service?

Lambda

### Describe the feature you'd like to request

I want to be able to set cookies in my lambda resolver. This would help me store secure, HTTP-only cookies.

### Describe the solution you'd like

I want to set cookies in the lambda function like
`
exports.handler = async (event, context, callback) => {

const response = {
headers : {
"Set-Cookie" : [`example-cookie=value`]
}
}
callback(null, response)

and the set cookie must be available as the response header of the Graphql HTTP call from the client.

### Describe alternatives you've considered

Tried to set the cookie client-side, but it is an insecure solution.

### Additional context

_No response_

### Is this something that you'd be interested in working on?

- [ ] 👋 I may be able to implement this feature request
- [ ] ⚠️ This feature might incur a breaking change

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the Lambda resolver response becomes the GraphQL HTTP response, focusing on how response headers are represented. Done means a resolver can return a cookie that appears in the GraphQL response headers, including secure and HTTP-only cookie attributes.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, graphql, typescript
Domain
api, backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.