Skip to content

Allow function fields to be generic #135

@captbaritone

Description

@captbaritone
/** @gqlField */
export function nodes<T>(connection: Connection<T>): T[] {
  return connection.edge.map(edge => edge.node);
}

Should act as a functional equivalent of a method on a generic class:

/** @gqlType */
class Connection<T> {
  // ... other fields/methods
  nodes(): T[] {
    return this.edges.map(edge => edge.node)
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions