captbaritone / captbaritone/grats

Allow function fields to be generic

Open
#135 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.