Type-graphql: Succinct Docs on Decorators

Created on 24 Feb 2019  路  3Comments  路  Source: MichalLytek/type-graphql

Describe the issue
I'm trying to find succinct information on decorators that can be used for type-graphql. For example, I see that @Args() can take in one or more arguments--but I couldn't find any information on what these arguments are and what order they should be in.

Is it that I can't find a page on the docs or is this just lacking?

Question Solved

Most helpful comment

but I couldn't find any information on what these arguments are and what order they should be in.

Just use "Go to Definition (F12)" or click the verb with CTRL in VSCode - it will show you all the overloads and the signature. It's very simple - ReturnTypeFunc when the reflection can't handle the type and ValidateOptions for class-validator options:

export function Args(
  paramTypeFunction: ReturnTypeFunc,
  options?: ValidateOptions,
): ParameterDecorator;

The signatures are really similar for many decorators, so please read the whole documentation website and the examples - it's better than an API reference or raw JSDocs.

All 3 comments

That's WIP. Already there's issue for that. #17

but I couldn't find any information on what these arguments are and what order they should be in.

Just use "Go to Definition (F12)" or click the verb with CTRL in VSCode - it will show you all the overloads and the signature. It's very simple - ReturnTypeFunc when the reflection can't handle the type and ValidateOptions for class-validator options:

export function Args(
  paramTypeFunction: ReturnTypeFunc,
  options?: ValidateOptions,
): ParameterDecorator;

The signatures are really similar for many decorators, so please read the whole documentation website and the examples - it's better than an API reference or raw JSDocs.

Closing for a housekeeping purposes 馃敀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tybot204 picture Tybot204  路  3Comments

MichalLytek picture MichalLytek  路  3Comments

memark picture memark  路  3Comments

tafelito picture tafelito  路  3Comments

avkonst picture avkonst  路  3Comments