aws / aws/aws-appsync-community
[JS] Difficult to specify the result type on `Context`
- Dominant language
- HTML
- Stars
- 507
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
When trying to type just the result of the backend request, you need to specify several irrelevant types which makes the resolver verbose and hard to grok at a glance. It's also very easy to forget which type parameter corresponds to what.
```ts
export function response(ctx: Context): string {
// ...
}
```
Contributor guide
Research direction
Start by locating the TypeScript definition of Context and the response resolver example shown in the issue. Check how its generic parameters are declared and used, then verify that a resolver can specify HttpResponse without supplying unrelated types. Done means the result type is expressible without the current sequence of never parameters, with relevant type-checking coverage added.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100