Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Succinct Docs on Decorators #262

Closed
robechun opened this issue Feb 24, 2019 · 3 comments
Closed

Succinct Docs on Decorators #262

robechun opened this issue Feb 24, 2019 · 3 comments
Labels
Question ❔ Not future request, proposal or bug issue Solved ✔️ The issue has been solved

Comments

@robechun
Copy link

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?

@mszekiel
Copy link
Contributor

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

@MichalLytek MichalLytek added the Question ❔ Not future request, proposal or bug issue label Feb 24, 2019
@MichalLytek
Copy link
Owner

MichalLytek commented Feb 24, 2019

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.

@MichalLytek
Copy link
Owner

Closing for a housekeeping purposes 🔒

@MichalLytek MichalLytek added the Solved ✔️ The issue has been solved label Mar 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question ❔ Not future request, proposal or bug issue Solved ✔️ The issue has been solved
Projects
None yet
Development

No branches or pull requests

3 participants