Skip to content

Use TypeScript 2.8's inferred types to make the dataloaders autocomplete #983

@orta

Description

@orta

We can use

type ReturnType<T extends (...args: any[]) => any> = T extends (...args: any[]) => infer R ? R : any;

to get the return type of all our dataloaders.

screen shot 2018-03-27 at 11 01 02 pm

and give it a name. Then we can do a declare of some sort for a resolver to attach that as context where we use it in the params.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions