captbaritone / captbaritone/grats
Allow function fields to be generic
Open
- Dominant language
- JavaScript
- Stars
- 358
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
```ts
/** @gqlField */
export function nodes(connection: Connection): T[] {
return connection.edge.map(edge => edge.node);
}
```
Should act as a functional equivalent of a method on a generic class:
```ts
/** @gqlType */
class Connection {
// ... other fields/methods
nodes(): T[] {
return this.edges.map(edge => edge.node)
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.